حَدَّثَنَا يَحْيَى بْنُ قَزَعَةَ، حَدَّثَنَا مَالِكٌ، عَنْ يَحْيَى بْنِ سَعِيدٍ، عَنْ مُحَمَّدِ بْنِ إِبْرَاهِيمَ بْنِ الْحَارِثِ، عَنْ عَلْقَمَةَ بْنِ وَقَّاصٍ، عَنْ عُمَرَ بْنِ الْخَطَّابِ ـ رضى الله عنه ـ قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ الْعَمَلُ بِالنِّيَّةِ، وَإِنَّمَا لاِمْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إِلَى اللَّهِ وَرَسُولِهِ فَهِجْرَتُهُ إِلَى اللَّهِ وَرَسُولِهِ صلى الله عليه وسلم وَمَنْ كَانَتْ هِجْرَتُهُ إِلَى دُنْيَا يُصِيبُهَا أَوِ امْرَأَةٍ يَنْكِحُهَا، فَهِجْرَتُهُ إِلَى مَا هَاجَرَ إِلَيْهِ ‏"‏‏.‏
Translation
Narrated `Umar bin Al-Khattab

The Prophet (ﷺ) said, "The rewards (of deeds) are according to the intention, and everybody will get the reward for what he has intended. So whoever emigrated for Allah's and His Apostle's sake, his emigration was for Allah and His Apostle; and whoever emigrated for worldly benefits, or to marry a woman, then his emigration was for the thing for what he emigrated for." (1)

Comment

Hadith of Intention (Niyyah)

This narration from Sahih al-Bukhari (5070) establishes the fundamental Islamic principle that all actions are judged by their underlying intentions. The Prophet Muhammad (ﷺ) categorically states that the spiritual value and divine reward of any deed are intrinsically tied to the purpose and objective in the heart of the performer.

Scholarly Commentary on Emigration Examples

The hadith provides two contrasting examples of emigration (Hijrah). The first emigrant seeks the pleasure of Allah and His Messenger, thus his action is elevated to the highest rank of worship. The second emigrant is motivated by worldly pursuits—either material gain or marriage (Nikaah).

Classical scholars explain that the one who emigrates for marriage fulfills a permissible worldly need but receives no spiritual reward for the act of emigration itself. His reward is limited to the lawful fulfillment of his intention. This demonstrates that permissible acts become acts of worship only when accompanied by sincere God-conscious intention.

Application to Wedlock and Marriage (Nikaah)

This hadith profoundly applies to marriage. When entering wedlock with the intention of fulfilling a Sunnah, protecting one's chastity, raising righteous children, and completing half of one's faith, the marriage becomes an act of worship yielding eternal reward.

Conversely, if one marries solely for physical attraction, social status, or wealth without higher spiritual purposes, the marriage remains lawful but yields limited spiritual benefit. The action takes its value from the intention behind it.

Universal Principle for All Deeds

Scholars emphasize that this principle extends beyond emigration to all human actions—including prayer, charity, and daily interactions. The purity of intention transforms mundane activities into worship when performed for Allah's pleasure.

This teaching encourages constant self-examination of one's motives, ensuring that the pursuit of lawful worldly matters like marriage is coupled with the higher objective of seeking Allah's pleasure and following the Prophetic example.