Abdul-Rahman reported,

Whenever the Messenger of Allah ﷺ prayed over a funeral, he would say, "O Allah, forgive our living and our dead, those present among us and those absent, our young and our old, our males and our females."Yahya said, Abu Salama bin Abdul-Rahman narrated to me from Abu Hurairah, from the Prophet ﷺ, the like of that, and he added in it, "O Allah, whoever You keep alive among us, keep him alive upon Islam, and whoever You cause to die among us, cause him to die upon faith."

Tirmidhi 1024

Sahih

حدثنا علي بن حجر أخبرنا هقل بن زياد حدثنا الأوزاعي عن يحيى بن أبي كثير حدثني

أبو إبراهيم الأشهلي عن أبيه قال

كان رسول الله ﷺ إذا صلى على الجنازة قال اللهم اغفر لحينا وميتنا وشاهدنا وغائبنا وصغيرنا وكبيرنا وذكرنا وأنثانا قال يحيى وحدثني أبو سلمة بن عبد الرحمن عن أبي هريرة عن النبي ﷺ مثل ذلك وزاد فيه اللهم من أحييته منا فأحيه على الإسلام ومن توفيته منا فتوفه على الإيمان

الترمذي 1024صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Funerals
Chapter
What to say in the funeral prayer
Numbering
Darussalam 1024
Tirmidhi 1024