The Messenger of Allah ﷺ was sent as a prophet at the age of forty. He remained in Mecca for thirteen years receiving revelation, then he was commanded to migrate. He stayed in Medina for ten years and died at the age of sixty-three.
بعث رسول الله ﷺ لأربعين سنة، فمكث بمكة ثلاث عشرة سنة يوحى إليه، ثم أمر بالهجرة، فمكث بالمدينة عشرا، ومات وهو ابن ثلاث وستين سنة.
Bukhari narrated it in Manaqib Ansar (3902), from Matar bin Fadl, who said, Rawh bin Ubada narrated to us, who said, Hisham narrated to us, who said, Ikrima narrated to us, from Ibn Abbas, who said, and he mentioned it.Muslim also narrated it in Kitab Fadail (2351), through another route, from Ibn Abbas, in similar wording.