From Sahih Muslim (Hadith 6095):
Amr reported:I said to 'Urwa: How long did Allah's Apostle (ﷺ) stay in Mecca? He said: For ten years. I said: Ibn Abbas says it is some years above ten. He ('Urwa) sought forgiveness for him and said: His statement is based on the verse of a poet
Reference: Muslim 6095