The Prophet Muhammad (peace be upon him) recited: "My servants who have transgressed against their souls (through sinning should) not despair of God's mercy, for God pardons all sins." (Quran, 39:53)
Al-Tirmidhi, Hadith 745
The Prophet also quoted the devil as saying to God: "I shall continue to lead Thy servants astray as long as their spirits are in their bodies." God replied: "(And) I shall continue to pardon them as long as they ask My forgiveness."
Al-Tirmidhi, Hadith 742