Scores of civilians have been killed, sometimes with children as executioners, and Iraqi and Kurdish troops have been attacked with chemical agents in the battle to take Mosul, Iraq, back from the Islamic State group.

GENEVA — Islamic State group militants have summarily killed scores of civilians in the Iraqi city of Mosul in recent days, sometimes using children as executioners, and have used chemical agents against Iraqi and Kurdish troops, U.N. officials said Friday.

Video posted by the militants on Wednesday showed four children, who appear to be 10 to 14 years old, shooting four civilians accused of disloyalty at a location near the Tigris River, said Ravina Shamdasani, a spokeswoman for the U.N. human-rights office in Geneva. The video release identified one of the children as Russian, another as coming from Uzbekistan and two as Iraqis.

U.N. investigators had not identified the time of the killings but believed they were recent, citing the surge in executions by Islamic State group courts and fighters in and around Mosul in recent weeks and the brutal training the militants have forced on children in the parts of Iraq and Syria they control.

“They are showing they are still in business,” Shamdasani said of the Islamic State group.

In one massacre, militants were said to have summarily shot 40 civilians in Mosul, dressing them in orange clothes adorned with words, marked in red, labeling them “traitors and agents of the ISF,” Shamdasani said, using the abbreviation for Iraqi Security Forces. Afterward, the militants strung up the bodies of their victims from electricity poles around the city — a practice the Islamic State group long used to strike fear into those who live in the strongholds.

The next day, Islamic State group fighters shot 20 civilians at a military base in the north of the city and also strung up their bodies with signs carrying statements like “used cellphones to leak information to the ISF,” Shamdasani said.

House-to-house fighting

The battle for Mosul, with tens of thousands of security forces bearing down on Iraq’s second-largest city, is now almost a month old. At the beginning, the fighting moved relatively quickly because the first objective was to clear dozens of outlying villages that, while they were defended by Islamic State group militants, were largely uninhabited by civilians, allowing government forces a freer hand to act.

But in the 10 days since Iraqi counterterrorism forces punched into the city itself from the east, the fighting has slowed, as soldiers go house to house in brutal urban fighting in areas where there are still many civilians.

Over the past week, the largest numbers of civilians so far have fled the fighting, with close to 48,000 people displaced as of Friday, according to the World Health Organization and the United Nations.

But that is nowhere near the total that officials worry could be in danger once the fighting moves to the most populated areas across the Tigris on the west side of Mosul, which is still believed to be home to at least one million people. Reports from inside the city indicate that the Islamic State group has set up elaborate defenses on the banks of the Tigris, including artillery pieces.

The United Nations said that militants were reported to have shot six civilians on Oct. 20 for keeping hidden SIM cards — to operate cellphones and other devices — in defiance of an order to surrender them. A week later, a 27-year-old man was killed for keeping a mobile phone, Shamdasani added.

Among the witnesses to the recent killings was the sole survivor from a group of 50 former members of Iraq’s security forces who was abducted by militants, taken to the Mosul airport and shot. Although wounded, “He pretended to be dead, escaped, and we spoke to him,” she said.

Meanwhile, a mass grave discovered on Monday by Iraqi troops near an agricultural college in the town of Hamam al-Alil was only one among numerous sites of large-scale killings, Shamdasani said. The grave contained at least 100 corpses, but Islamic State fighters were also reported to have dumped bodies down a well and at a cement factory yard in the same town, and at several other locations including the Mosul airport and in the Tigris.

On a lengthening list of atrocities reported from Mosul, militants had deployed “sons of the Caliphate,” believed to be teenagers or younger, around the old town armed with explosive belts. They had also brought abducted women, some of them members of Iraq’s Yazidi minority, into the city to distribute them as slaves for their fighters.

Interviews with residents inside Mosul in recent days indicate a pattern of brutality by the Islamic State group much like what the U.N. has been reporting, including an increase in the number of boys on the streets carrying rifles and swords. One resident told The New York Times that the Islamic State group in recent days had executed 18 former security-force members and driven their bodies in the back of a pickup truck to a freshly dug mass grave.

Chemical weapons, human shields

In addition to the Islamic State group’s forcibly moving civilians into Mosul for use as human shields to deter attack, the United Nations said it had credible reports of the group’s fighters’ using chemical weapons and chemical agents like chlorine gas against advancing Iraqi and Kurdish forces. Shamdasani said that Iraqi troops entering the city had found large quantities of sulfur and ammonia stockpiled in civilian areas of the city.

The discovery raised fears that the chemicals could be used as a weapon to slow advancing government forces or punish civilians left behind after militants set on fire and shelled a sulfur gas factory in a subdistrict of Mosul. Four civilians died after inhaling fumes from burning sulfur, she added. Militants had also reportedly dumped sulfur in trenches and pits in Mosul and were holding civilians nearby.

Human-rights officials are also receiving accounts of revenge killings by pro-government forces, targeting local Sunni civilians they accused of aiding or supporting the Islamic State group and deepening fears that sectarian strife will continue after the battle for Mosul has ended.

Voicing outrage at the “numbing and intolerable” suffering inflicted on civilians by the unfolding conflict, the U.N. human-rights chief, Zeid Ra’ad al-Hussein, in a statement on Friday demanded immediate action by the Iraqi government to protect fleeing or freed residents of areas held by the Islamic State group and to bring the attackers to justice.

Quick action could save lives by discouraging people from taking the law into their own hands, Shamdasani said.