Abu Bishr narrates from Sa'id bin Jubayr (may Allah have mercy on him), regarding the saying of Allah: "There is no compulsion in religion" [Surah al-Baqarah: 256], that there is no compulsion in Islam. He said: It was revealed about the Ansar. I asked: Specifically about the Ansar? He said: Specifically about the Ansar. When a woman among them would vow that if she gave birth to a child she would join him to the Jews, she was seeking by that his long life. When Islam came, some people were in this situation. When Banu al-Nadir were exiled, the Ansar said: "O Messenger of Allah (peace and blessings be upon him)! Our sons and brothers are among them." The Messenger of Allah (peace and blessings be upon him) remained silent, and then this verse was revealed: "There is no compulsion in religion" [Surah al-Baqarah: 256]. Then the Messenger of Allah (peace and blessings be upon him) said: "These people of yours have been given the choice: if they wish to stay with them, then exile them along with them; and if they wish to stay with you, they may stay."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجزية / 18640