Sa'id bin Jubayr (may Allah have mercy on him) narrates from Abdullah bin Abbas (may Allah be pleased with them both) regarding the saying of Allah Almighty: "There is no compulsion in religion" [Surah al-Baqarah: 256], that he said: A woman of the Ansar whose children would not survive would swear that if a child of hers survived, she would make him a Jew. When Banu al-Nadir were exiled, among them were some of the children of the Ansar, so the Ansar said: "O Messenger of Allah (peace and blessings be upon him)! Our sons!" So Allah Almighty revealed: "There is no compulsion in religion" [Surah al-Baqarah: 256]. Sa'id bin Jubayr (may Allah have mercy on him) said: Whoever wished could join them, and whoever wished could enter Islam.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجزية / 18639