The last words of the Messenger of Allah ﷺ were, "The prayer, the prayer. Fear Allah regarding those whom your right hands possess."
حدثنا محمد بن فضيل حدثنا المغيرة عن أم موسى
كان آخر كلام رسول الله ﷺ الصلاة الصلاة اتقوا الله فيما ملكت أيمانكم
Its chain of transmission is sahih. Mughira is Ibn Miqsam Dabbi, and Umm Musa is Ali's concubine, as previously mentioned in 579.