I am trying to recall a hadith about a man who worshiped through out his life, but Iblees managed to deceive him in the last moment and he went to Hell; and another man of Hell went to Paradise likewise.
What was the complete version?
'Abdullah bin Mas'ud said:
"The Messenger of Allah, the true and truly inspired one, told us that: 'The creation of one of you is put together in his mother's womb for forty days, then it becomes a clot for a similar length of time, then it becomes a chewed lump of flesh for a similar length of time. Then Allah sends the angel to him and commands him to write down four things. He says: "Write down his deeds, his life span, his provision, and whether he is doomed (destined for Hell) or blessed (destined for Paradise)." By the One in Whose Hand is my soul! One of you may do the deeds of the people of Paradise until there is no more than a forearm's length between him and it, then the decree overtakes him and he does the deeds of the people of Hell until there is no more than a forearm's length between him and it, then the decree overtakes him and he does the deeds of the people of Paradise until he enters therein."
> Sunan Ibn Majah, The Book of the Sunnah, English reference: Vol. 1, Book 1, Hadith 76 Arabic reference: Book 1, Hadith 80