Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) narrates: Once the Prophet (peace and blessings be upon him) came out to us holding something in his fist. He opened his right hand and said: "In the name of Allah, the Most Gracious, the Most Merciful. This is a writing from the Most Gracious, the Most Merciful. In it are the people of Paradise, their number, their names and their lineages, all those who will be until the Day of Resurrection. None will be decreased from them and none will be added to them. Sometimes a fortunate person is made to walk the path of wretchedness, until it is said: 'He is one of them (the wretched), and how much he resembles them!' But then he moves to his fortune before he dies, even if it is only as long before his death as the interval between two milkings of a she-camel." Then the Prophet (peace and blessings be upon him) opened his left hand and said: "In the name of Allah, the Most Gracious, the Most Merciful. This writing is from the Most Gracious, the Most Merciful. In it are the people of Hell, their number and their names; all who will be until the Day of Resurrection are mentioned in it. None will be decreased from them and none will be added to them. Those who are wretched walk the paths of the fortunate, and it is said that they are among the (fortunate), and how much they resemble them! But then wretchedness overtakes one of them before his death, even if it is as long before as the interval between two milkings of a she-camel." Then the Prophet (peace and blessings be upon him) said: "Deeds are judged by their endings." He (peace and blessings be upon him) said this three times.
Al-Bazzar recorded it; its chain contains Abdullah bin Maymun al-Qaddah, who is extremely da'if (weak). Al-Bazzar said: he is salih (acceptable). The rest of its narrators are the narrators of the Sahih.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب القدر / 11919