When the Messenger of Allah (may peace he upon him) went out on the 'Id day, he ordered to carry a spear-and it was fixed in front of him, and he said prayer towards its (direction), and the people were behind him. And he did it in the journey, and that is the reason why the Amirs carried it.
أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ إِذَا خَرَجَ يَوْمَ الْعِيدِ أَمَرَ بِالْحَرْبَةِ فَتُوضَعُ بَيْنَ يَدَيْهِ فَيُصَلِّي إِلَيْهَا وَالنَّاسُ وَرَاءَهُ وَكَانَ يَفْعَلُ ذَلِكَ فِي السَّفَرِ فَمِنْ ثَمَّ اتَّخَذَهَا الأُمَرَاءُ