Sahih al-Bukhari 3851
Sahih al-Bukhari · Book 63: Merits of the Helpers in Madinah (Ansaar) · The advent of the Prophet (saws)
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.