The Book of Jihad and Expedition (Kitab Al-Jihad wa'l-Siyar)

Muslim :: Book 19 : Hadith 4318

It is narrated on the authority of Anas that the Messenger of Allah (may peace be upon him) said on the day of the Battle of Ubud: O Allah, if Thou wilt (defeat Muslims), there will be none on the earth to worship Thee.

Source materials are from the University of Southern California MSA site
Hadith eBooks converted from Imaan Star