Command him to take her back until she is pure and then she enters the second menses and then becomes pure. Then either divorce her (finally) or retain her.
Sahih Muslim Book 18, Hadith 9