It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) had a slave girl with whom he had relations. The Mother of the Believers Sayyidah Aishah and the Mother of the Believers Sayyidah Hafsah (may Allah be pleased with them both) kept pressing him persistently until he (peace and blessings be upon him) made her unlawful for himself. Then Allah Almighty revealed this verse: "O Prophet, why do you prohibit what Allah has made lawful for you, seeking the approval of your wives?" to the end of the verse.
Imam al-Nasa'i (may Allah have mercy on him) narrated it in this way.