Then Ali ransomed Khawla and set her free and, after the death of his wife Fatima, married her, after which she became pregnant and gave birth to Muhammad ibn al-Hanafiyya.
After freeing Khawla through ransom, Ali married her after the death of his wife Fatima.  She subsequently became pregnant and delivered Muhammad ibn al-Hanafiyya.