Hadith 987
Anas (May Allah be pleased with him) reported:
وعن أنس رضي الله عنه قال: أقبلنا مع النبي صلى الله عليه وسلم ، حتي إذ كنا بظهر المدينة، قال: "آيبون، تائبون ، عابدون ، لربنا حامدون" فلم يزل يقول ذلك حتي قدمنا المدينة، ((رواه مسلم)).
We returned with the Prophet (ﷺ) from a journey; and when we entered the suburbs of Al- Madinah, he (ﷺ) said: "Ayibuna, ta'ibuna, 'abiduna, li-Rabbina hamidun (We are returning in safety, turning to our Rubb, worshipping Him and praising Him)." He (ﷺ) continued repeating these words till we entered Al-Madinah. [Muslim].
In plain words
As Medina came into view on the way home, the Prophet repeated that they were returning safely, repenting, worshipping, and praising their Lord, turning the homecoming into a moment of gratitude.
Reference : Riyad as-Salihin 987 In-book reference : Book 7, Hadith 32