Anas told of a man who came and said, “Messenger of God, I have done something which merits punishment, so appoint it for me.” He did not question him about it, and when the time for prayer came the man prayed along with him. Then when the Prophet had finished the prayer the man got up and said, “Messenger of God, I have done something which merits punishment, so appoint for me that God has decreed.” He asked, “Did you not pray along with us?” and when he replied that he had, he said, “Well, God has forgiven you your offence, or “your punishment”.
Ibn Mas'ud said that a man kissed a woman and came and told the Prophet. Then God revealed, “And observe the prayer at the two ends of the day and the neighbouring parts of the night, for good deeds remove evil deeds (Al- Qur’an, 11:114).”’ The man asked God’s Messenger whether this referred to him, and he replied, “It refers to every one of my whole people.” A version has, “To those of my people who act upon it.”
I asked the Prophet which action is dearest to God and he replied, “Prayer at its proper time.” I asked what came next, and he replied that it was kindness to parents. I asked what came next and he replied that it was jihad in God's path. He said, “He told me of them, and if I had asked for more he would have told me more.”
He also reported God’s Messenger as saying, “Tell me, if there were a river at the door of one of you in which he washed five times daily, would any of his filthiness remain?” When he received the reply that none of it would remain, he said, “That is like the five times of prayer by which God obliterates sins.”