Saeed bin Jubair narrates: It was asked from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) about a man and a woman who commit a forbidden act with each other, and then afterwards want to marry. So Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) said: "Their first act was adultery, but the second act will be considered marriage."
Hadith Referenceسنن الدارقطني / كتاب النكاح / 3681
Hadith Takhrij«أخرجه سعيد بن منصور فى ((سننه)) برقم: 886، 887، والبيهقي فى((سننه الكبير)) برقم: 13989، والدارقطني فى ((سننه)) برقم: 3681، وعبد الرزاق فى ((مصنفه)) برقم: 12785،وابن أبى شيبة فى ((مصنفه)) برقم: 17046، 17060، 17063»