Abdullah bin al-Samit (may Allah have mercy on him) said: Sayyiduna al-Hakam bin Amr al-Ghifari (may Allah be pleased with him) led the people in prayer on a journey with a barrier (sutrah) in front of him. Then some donkeys passed in front of those praying behind him, so he led them in the prayer again. At this the people said: He wanted to do what al-Walid bin Uqbah did when he led his companions in the dawn prayer with four rak'ahs and then said: Shall I give you more? So I caught up with Sayyiduna al-Hakam (may Allah be pleased with him) and mentioned this to him. He stopped until the people caught up with him, then said: "I repeated the prayer with you because of the donkeys that passed in front of you, and you made me an example of Ibn Abi Mu'ayt. I ask Allah to make your conduct good, to bring you safely (to your destination), to help you against your enemy, and to separate me from you." Then they went on, and on that journey of theirs they saw nothing but what pleased them; and when they had finished (the journey), al-Hakam (may Allah be pleased with him) passed away.
Hadith Referenceالمعجم الكبير للطبراني / باب الحاء / 3138