Sahih al-Bukhari · Hadith 3851

حَدَّثَنَا أَحْمَدُ بْنُ أَبِي رَجَاءٍ، حَدَّثَنَا النَّضْرُ، عَنْ هِشَامٍ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ ـ رضى الله عنهما ـ قَالَ أُنْزِلَ عَلَى رَسُولِ اللَّهِ صلى الله عليه وسلم وَهْوَ ابْنُ أَرْبَعِينَ، فَمَكَثَ ثَلاَثَ عَشْرَةَ سَنَةً، ثُمَّ أُمِرَ بِالْهِجْرَةِ، فَهَاجَرَ إِلَى الْمَدِينَةِ، فَمَكَثَ بِهَا عَشْرَ سِنِينَ، ثُمَّ تُوُفِّيَ صلى الله عليه وسلم‏.‏

Narrated Ibn `Abbas:Allah's Messenger (ﷺ) was inspired Divinely at the age of forty. Then he stayed in Mecca for thirteen years, and then was ordered to migrate, and he migrated to Medina and stayed there for ten years and then died

Narrated by Ibn `Abbas