Ruling on the Talaq pronounced jokingly

Q: One day in the month of Sha‘ban, 1409 A.H., I was having lunch with my colleagues. (Part No. 20; Page No. 65) They jokingly said to me, “Your wife has gone to her family’s house, she no longer wants you.” So I said to them, “She is divorced!” They said, “You have divorced her now.” I told them that I had not pronounced Talaq (divorce). My colleagues went to the shaykh in Abha, where we were working, and we asked him about the ruling on what had happened. He told them that I had to offer a Kaffarah (expiation). My colleagues took 400 Riyals from me to give to the poor as the Kaffarah. Then I returned home to my wife and family. Two months after that incident, after ‘Eid-ul-Fitr (the Festival of Breaking the Fast), I had conjugal intercourse with her. No one, other than the colleagues who were with me at the time, knows anything about what happened. My question now is: Is what we did permissible and valid? Please give us a Fatwa (legal opinion from a qualified Muslim scholar) on this matter and may Allah reward you with the best.

A: If the reality is as you mentioned, you have divorced your wife once, as you said, “She is divorced.” This is because divorce becomes effective when pronounced seriously or jokingly. However, you can take her back in marriage as long as she is still in her ‘Iddah (woman’s prescribed waiting period after divorce), on the condition that you had not previously divorced her twice. If she had not menstruated three times when you had sexual intercourse with her after ‘Eid-ul-Fitr, she is still your wife, because having intercourse with her is regarded as taking her back in marriage. If however she had menstruated three times before you had sexual intercourse with her after ‘Eid-ul-Fitr and after the pronouncement of the divorce mentioned above, she is not Halal (lawful) to you as a wife, except through a new marriage contract. May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.