كتاب الطلاق
18  
The Book of Divorce
(1)
Chapter: The prohibition of divorcing a menstruating woman without her consent; If a man breaks this rule, it still counts as a divorce, and he should be ordered to take her back
(1)
باب تَحْرِيمِ طَلاَقِ الْحَائِضِ بِغَيْرِ رِضَاهَا وَأَنَّهُ لَوْ خَالَفَ وَقَعَ الطَّلاَقُ وَيُؤْمَرُ بِجْعَتِهَا
Sahih Muslim 1471 c

Ibn Umar (Allah be pleased with them) reported:

I divorced my wife during the lifetime of Allah's Messenger (ﷺ) when she was in the state of menses. 'Umar (Allah be pleased with him) made a mention of it to Allah's Messenger (ﷺ), whereupon he said: Command him to take her back and leave her (in that state) until she is purified. Then (let her) enter the period of second menses, and when she is purified, then divorce her (finally) before having a sexual intercourse with her, or retain her (finally). That is the 'Idda (the prescribed period) which Allah commanded (to be kept in view) while divorcing the women. 'Ubaidullah reported: I said to Nafi': What became of that divorce (pronounced within 'Idda)? He said: It was as one which she counted.
حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ نُمَيْرٍ، حَدَّثَنَا أَبِي، حَدَّثَنَا عُبَيْدُ اللَّهِ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ طَلَّقْتُ امْرَأَتِي عَلَى عَهْدِ رَسُولِ اللَّهِ صلى الله عليه وسلم وَهْىَ حَائِضٌ فَذَكَرَ ذَلِكَ عُمَرُ لِرَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ ‏ "‏ مُرْهُ فَلْيُرَاجِعْهَا ثُمَّ لْيَدَعْهَا حَتَّى تَطْهُرَ ثُمَّ تَحِيضَ حَيْضَةً أُخْرَى فَإِذَا طَهُرَتْ فَلْيُطَلِّقْهَا قَبْلَ أَنْ يُجَامِعَهَا أَوْ يُمْسِكْهَا فَإِنَّهَا الْعِدَّةُ الَّتِي أَمَرَ اللَّهُ أَنْ يُطَلَّقَ لَهَا النِّسَاءُ ‏"‏ ‏.‏ قَالَ عُبَيْدُ اللَّهِ قُلْتُ لِنَافِعٍ مَا صَنَعَتِ التَّطْلِيقَةُ قَالَ وَاحِدَةٌ اعْتَدَّ بِهَا ‏.‏
Reference : Sahih Muslim 1471c
In-book reference : Book 18, Hadith 3
USC-MSA web (English) reference : Book 9, Hadith 3475
  (deprecated numbering scheme)