The Messenger of Allah ﷺ remained for nine years without performing Hajj. Then in the tenth year he announced to the people that the Messenger of Allah ﷺ was going to perform Hajj... and the hadith continues at length.
إن رسول الله ﷺ مكث تسع سنين لم يحج ثم أذن في الناس في العاشرة أن رسول الله ﷺ حاج… الحديث بطوله.
Muslim narrated it in the book of Hajj (1218) via Hatim bin Ismail Madani, from Jafar bin Muhammad (he is the son of Ali bin Husayn bin Ali bin Abu Talib), from his father, from Jabir, with this same wording, mentioning it within a long hadith describing the Hajj of the Prophet ﷺ.