It is narrated from Sayyiduna Abdullah bin Amr (may Allah be pleased with him): the Prophet (peace and blessings be upon him) said: "Whoever would like to be saved from Hell and to enter Paradise, then when death comes to him his state should be that he bears witness that there is no god but Allah Almighty and that Sayyiduna Muhammad (peace and blessings be upon him) is His servant and His Messenger, and that he treats people the way he would like to be treated."
Al-Tabarani recorded it in al-Mu'jam al-Awsat; its chain contains a narrator, Layth bin Abi Sulaym, who is a mudallis; its remaining narrators are thiqat (trustworthy).