Abu Saeed Khudri reported,

The Prophet ﷺ loved palm-branch sticks and almost always held one in his hand. He entered the mosque and saw some phlegm on the wall facing the qiblah, so he scraped it off. Then he turned to the people, angry, and said, "Would any of you be pleased if someone spat in his face? When one of you faces the qiblah, he is only facing his Lord عز وجل, with the angel on his right. So let him not spit to his right, nor toward the qiblah. Let him spit to his left, or beneath his foot. And if something forces him to spit quickly, let him do like this."Ibn Ajlan demonstrated it for us, that he should spit into his garment and then fold part of it over the other.

Abu Dawud 480

Sahih

حدثنا يحيى بن حبيب بن عربي حدثنا خالد يعني ابن الحارث عن محمد بن عجلان عن عياض بن عبد الله

عن أبي سعيد الخدري

أن النبي ﷺ كان يحب العراجين ولا يزال في يده منها فدخل المسجد فرأى نخامة في قبلة المسجد فحكها ثم أقبل على الناس مغضبا فقال أيسر أحدكم أن يبصق في وجهه إن أحدكم إذا استقبل القبلة فإنما يستقبل ربه عز وجل والملك عن يمينه فلا يتفل عن يمينه ولا في قبلته وليبصق عن يساره أو تحت قدمه فإن عجل به أمر فليقل هكذا ووصف لنا ابن عجلان ذلك أن يتفل في ثوبه ثم يرد بعضه على بعض

أبو داود 480صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Prayer
Chapter
Dislike of spitting in the masjid
Numbering
Darussalam 480
Abu Dawud 480