Ikrimah (may Allah have mercy on him) asked Abdullah bin Abbas (may Allah be pleased with them both) about a man who commits zina with a woman and then marries her. He said: "The first was zina and the second is marriage; the first was unlawful and the second is lawful."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 13878