The Prophet, peace and blessings be upon him, said to Gabriel when Gabriel asked him about faith: “It is to believe in Allah, His angels, His books, and His messengers.”
Gabriel then asked, “If I do that, am I a believer?”
He replied, “Yes.”
Gabriel continued, “What is Islam?”
He answered, “It is to testify that there is no god but Allah and that I am the Messenger of Allah,” and the Prophet went on to detail the rest.
Gabriel asked, “If I do that, am I a Muslim?”
He said, “Yes.”
Abu ʿAbd Allah commented: “Thus he designated faith, Islam, the testimony, excellence (ihsan), and the prayer—with its recitation and the bodily motions of bowing and prostration—as deeds performed by the servant. He also cited the verse, ‘Allah bears witness that there is no deity except Him, as do the angels and those endowed with knowledge’ (Qur’an 3:18).”