Imam al-Sha'bi (may Allah have mercy on him) narrates that Sayyiduna Ali (may Allah be pleased with him) offered the funeral prayer over Sayyiduna Ammar bin Yasir and Hashim bin Utbah (may Allah be pleased with them both); he placed Ammar next to himself and Hashim in front of him, and when they were lowered into the grave, Ammar was lowered first and then Hashim, who had been next to him.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6825