It is narrated from Sayyiduna Khufaf bin Ima' (may Allah be pleased with him); he said: The Messenger of Allah (peace and blessings be upon him) bowed, then raised his head and said: "Ghifar, may Allah forgive them; Aslam, may Allah keep them safe; and Usayyah disobeyed Allah and His Messenger. O Allah, curse Banu Lihyan, Ri'l and Dhakwan." Then he fell down in prostration. Khufaf (may Allah be pleased with him) said: It was for this reason that cursing the disbelievers (in prayer) was established.
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 4159