Ibn Sirin narrated that Sayyiduna Ibn Mas'ud (may Allah be pleased with him) was asked about a man who commits adultery with a woman and then marries her. He said: "They both remain adulterers as long as they are together." Sayyiduna Ibn Mas'ud (may Allah be pleased with him) was asked: What do you think if they both repent? He said: "And it is He who accepts repentance from His servants and pardons evil deeds" [Surah al-Shura: 25], and Sayyiduna Ibn Mas'ud (may Allah be pleased with him) kept repeating this verse. The narrator said: Until I said: He sees no harm in it (marriage after repentance).
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 9635