It is narrated from Sayyiduna Anas (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) used to attack (the enemy) at the time of Fajr prayer and would listen attentively; if he heard the (Fajr) adhan, he would not attack, and if he did not hear the adhan, then he would attack.
Hadith Referenceسنن دارمي / من كتاب السير / 2482
Hadith Gradingتحقیق (حسین سلیم أسد الدارانی):إسناده صحيح والحديث متفق عليه، [مكتبه الشامله نمبر: 2489]
Hadith Takhrijاس روایت کی سند صحیح اور حدیث متفق علیہ ہے۔ دیکھئے: [بخاري 610] ، [مسلم 382] ، [أبوداؤد 2634] ، [ترمذي 1618] ، [أبويعلی 3307]
Brief Explanation
(Commentary on Ahadith 2479 to 2482)
From this hadith, it is understood that it is not permissible to attack a settlement in which Muslims and non-Muslims reside together.