أَخْبَرَنِي إِبْرَاهِيمُ بْنُ يُونُسَ بْنِ مُحَمَّدٍ، حَرَمِيٌّ - هُوَ لَقَبُهُ - قَالَ حَدَّثَنَا أَبِي قَالَ، حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، عَنْ ثَابِتٍ، عَنْ أَنَسٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَتْ لَهُ أَمَةٌ يَطَؤُهَا فَلَمْ تَزَلْ بِهِ عَائِشَةُ وَحَفْصَةُ حَتَّى حَرَّمَهَا عَلَى نَفْسِهِ فَأَنْزَلَ اللَّهُ عَزَّ وَجَلَّ ‏{‏ يَا أَيُّهَا النَّبِيُّ لِمَ تُحَرِّمُ مَا أَحَلَّ اللَّهُ لَكَ ‏}‏ إِلَى آخِرِ الآيَةِ ‏.‏

It was narrated from Anas, that the Messenger of Allah had a female slave with whom he had intercourse, but 'Aishah and Hafsah would not leave him alone until he said that she was forbidden for him. Then Allah, the Mighty and Sublime, revealed: "O Prophet! Why do you forbid (for yourself) that which Allah has allowed to you.' until the end of the Verse. Translation Not Available

Book Ref: Sunan An Nisai Book 36 Hadith 3959
Web Ref:  Sunan An Nisai Vol 4 Book 36 Hadith 3411