Hazrat Ikrimah (may Allah have mercy on him) said: "A man who commits adultery with a woman and then marries her, his example is like that of a person who plucks fruit from a tree without permission, so it is unlawful; then if he buys it, it becomes lawful."
Hadith Referenceسنن سعید بن منصور / كتاب النكاح / 2071