Abu al-Ala reported on the authority of his father: I came to the Messenger of Allah ﷺ who was saying prayer. He spat beneath his left foot.
Related hadith on this topic
Explanation & Benefits
Shaykh Umar Farooq Saeedi
482. Commentary:
Spitting, phlegm, and nasal discharge do not invalidate the prayer, and on soft ground, a person should rub it away with his left foot.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 482
Shaykh Maulana Abdul Aziz Alvi
Hadith Commentary: Benefits and Issues: From this hadith, it is understood that the meaning of burying spittle, etc., in the mosque is to rub it away with one's left shoe, so that it is removed in this manner. It does not mean that the ground should be dug up and the spittle buried in it.
Source: Tuhfat al-Muslim: Commentary on Sahih Muslim, Page: 1235