Sunan Abi Dawud, Book 20, Hadith 3206 (USC-MSA)

Narrated Al-Bara' ibn Azib: We went out with the Messenger of Allah to the funeral of a man of the Ansar, but when we reached the grave, the niche in the side had not yet been made, so the Prophet sat down facing the qiblah, and we sat down along with him.

حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا جَرِيرٌ، عَنِ الأَعْمَشِ، عَنِ الْمِنْهَالِ بْنِ عَمْرٍو، عَنْ زَاذَانَ، عَنِ الْبَرَاءِ بْنِ عَازِبٍ، قَالَ خَرَجْنَا مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم فِي جَنَازَةِ رَجُلٍ مِنَ الأَنْصَارِ فَانْتَهَيْنَا إِلَى الْقَبْرِ وَلَمْ يُلْحَدْ بَعْدُ فَجَلَسَ النَّبِيُّ صلى الله عليه وسلم مُسْتَقْبِلَ الْقِبْلَةِ وَجَلَسْنَا مَعَهُ ‏.‏

sunnah.com