GENEVA — Islamic State fighters shot and killed hundreds of residents in the Iraqi city of Mosul in the past two weeks, the United Nations said on Thursday, describing an increasingly desperate drive by the jihadists to prevent civilians from fleeing.

Iraqi forces, backed by airstrikes from a United States-led coalition, have made advances into the city, and the Islamic State, also known as ISIS or ISIL, has responded in brutal fashion to halt the flight of civilians they want to use as human shields, the United Nations said.

The deadliest attack came June 1, when at least 163 civilians, including women and children, were killed near a Pepsi factory as they headed out of the Shifa neighborhood of Mosul, the United Nations’ human rights office in Geneva said.

“They were gunned down as they were fleeing,” said Ravina Shamdasani, a spokeswoman for the human rights office, which reported that, as of two days ago, the bodies of the victims were still lying in the streets.