Abdullah bin Umar reported,

Whenever the Messenger of Allah ﷺ went out on the day of Eid, he would order that a spear be brought and planted in front of him, and he would pray facing it while the people stood behind him. He would do the same while traveling, and from this practice the rulers adopted it.

Azami 2519

Sahih

عن ابن عمر

أن رسول الله ﷺ كان إذا خرج يوم العيد أمر بالحربة فتوضع بين يديه، فيصلي إليها، والناس وراءه، وكان يفعل ذلك في السفر، فمن ثم اتخذ الأمراء.

الأعظمي 2519صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Sutrah
Section
Seeking to pray toward a sutrah such as a pillar and the like
Numbering
Jami al-Kamil 2519 (2nd edition)
Azami 2519