Sayyiduna Amr bin Murrah al-Juhani (may Allah be pleased with him), who had the honour of being a Companion, narrates: Once al-Hakam bin Abi al-As asked permission to come in to the Prophet (peace and blessings be upon him). The Prophet (peace and blessings be upon him) recognised his voice, and he (peace and blessings be upon him) said: "Give him permission! Upon him be the curse of Allah Almighty, the angels and all mankind, and a curse also upon those who will come out of his loins, except for those among them who are righteous, and such people will be few. They (that is, those who come from his loins) will hold prominent standing in this world and will be destitute in the Hereafter; they will be people of deception and deceit."
Al-Tabarani recorded it in this way. Another narration has the wording: "And a curse also upon whoever comes out of his loins, except that the ruling of the righteous among them is different, and they will be few." Its chain contains a narrator, Abu al-Hasan al-Jazari, who is mastur (of unknown standing), and the rest of the narrators of this report are thiqat (trustworthy).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الخلافة / 9241