Sahih Muslim
“Should I not narrate to you (a hadith of the Holy Prophet) on my authority and on the authority of my mother? ... She said: When it was my turn for Allah's Messenger (ﷺ) to spend the night with me, he turned his side, put on his mantle and took off his shoes and placed them near his feet, and spread the corner of his shawl on his bed and then lay down till he thought that I had gone to sleep. He took hold of his mantle slowly and put on the shoes slowly, and opened the door and went out and then closed it lightly. I covered my head, put on my veil and tightened my waist wrapper, and then went out following his steps till he reached Baqi'. He stood there and he stood for a long time. He then lifted his hands three times, and then returned and I also returned... He (the Holy Prophet) entered the (house), and said: Why is it, O 'A'isha, that you are out of breath?... He said: Gabriel came to me when you saw me. He called me and he concealed it from you. I responded to his call, but I too concealed it from you... He (Gabriel) said: Your Lord has commanded you to go to the inhabitants of Baqi' (to those lying in the graves) and beg pardon for them. I said: Messenger of Allah, how should I pray for them? He said: Say, Peace be upon the inhabitants of this city (graveyard) from among the Believers and the Muslims, and may Allah have mercy on those who have gone ahead of us, and those who come later on, and we shall, God willing, join you.”
Sahih Muslim -- Aisha's hadith of the Prophet's night visit to Baqi' after Gabriel's command to pray for its people. Matched against local corpus (Sahih Muslim, Kitab al-Janaiz); sunnah.com URL could not be verified via search.