ERBIL, Iraq — Day after day, the miseries of life pile up in camps for civilians driven from their homes by fighting between Iraqi forces and Islamic State militants in Mosul. The searing heat has been made worse by a lack of electricity to power air-conditioners. Hearts ache for missing loved ones. Uncertainty about when, or if, they can ever go home lingers.

Food, though, usually is not the problem, especially during the holy month of Ramadan, when the pious reach deep into their pockets to help the needy.

On Monday at sundown, hundreds of residents of one of the many tent camps that have sprawled across the barren landscape around Mosul gathered for iftar, the evening meal to break the day’s Ramadan fast. They were treated to a meal of chicken, rice, soup, beans and yogurt — paid for by a Qatari charity and prepared by a restaurant in Erbil, the capital of the autonomous Kurdish region.

Within hours, hundreds fell sick, vomiting and suffering from diarrhea. Overnight, until about 4 a.m., ambulances and cars rushed victims to hospitals, said Alaa Muhsin, an ambulance driver from Baghdad who works at the camp.