Al-Hasan said: Sayyiduna Ammar (may Allah be pleased with him) used to say: I fought against jinn and humans alongside the Prophet (peace and blessings be upon him). The Prophet (peace and blessings be upon him) sent me to the well of Badr, and I met a devil in human form. He wrestled with me and I threw him down, and I began to pound him with a stone I had with me. The Prophet (peace and blessings be upon him) said: Ammar has encountered a devil at the well, and Ammar fought him. The narrator said: Then I came back and told the Prophet (peace and blessings be upon him) about it, and the Prophet (peace and blessings be upon him) said: That was the devil.
Al-Tabarani recorded it from his teacher Ya'qub bin Ishaq al-Makhrami, whom I do not know; its chain contains al-Hakam bin Atiyyah, about whom there is disagreement, and the rest of its narrators are the narrators of the Sahih.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب المناقب / 15594