The last words which the Messenger of Allah (ﷺ) spoke were: Prayer, prayer; fear Allah…

Sunan Abu Dawud Book 43 Hadith 384

Sunan Abu Dawud #5156

General Behavior (Kitab Al-Adab) 43:384

Narrated Ali ibn AbuTalib:

The last words which the Messenger of Allah (ﷺ) spoke were: Prayer, prayer; fear Allah about those whom your right hands possess.

Chapter: Regarding the rights of slaves

Grade: Sahih (Al-Albani)