It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) that when the Messenger of Allah (peace and blessings be upon him) went out (for the prayer) on the day of Eid, he would order that the spear be carried along. It would be planted in front of him and he would pray facing it, with the people behind him. He would do the same on journeys, and it is for this reason that rulers have made it a practice to keep a spear with them.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3462