BAGHDAD — It was weeks ago that Iraqi and United States officials declared the city of Ramadi liberated from the Islamic State, yet the fighting has dragged on in some neighborhoods. As Iraqi commandos advance slowly, house to house and under American air cover, hundreds of civilians are still fleeing the violence, many of them malnourished.

One of them is Abdul Hameed, who several days ago reached government lines. There, women and children are shunted to one camp, and the men to another to be interrogated about any possible ties to the Islamic State. After two days, he was let go, only to find that his 4-year-old son, Wisam, had died of dehydration.

“I do not know where to start and when to stop,” said Mr. Hameed, 41, reached by telephone Tuesday night from a refugee camp near Ramadi, when asked what his family had endured. “Only God knows about our suffering.”

The United Nations on Tuesday released one accounting of Iraq’s suffering: nearly 19,000 people killed, close to 40,000 wounded and more than three million displaced from their homes over a 22-month period that was marked, as the report described it, by a “staggering level of violence.” The report tracked casualties from January 2014, roughly when the Islamic State began seizing territory, through October 2015.

The United Nations said most of the casualties had been at the hands of the Islamic State, also called ISIS or ISIL. But there are myriad other ways an Iraqi can die: sectarian violence by militias, untreated illness and malnutrition, a wayward airstrike, abuse by government forces.

Video

Ramadi, just west of Baghdad, has been heavily damaged by the Islamic State, also called Daesh, and the fight against the group by Iraqi forces and Western allies.Published OnJan. 19, 2016CreditCreditThaier Al-Sudani/Reuters

The figures were not entirely new; they are mostly the accumulation of figures the United Nations tracks monthly. But seeing them added up gives a hint of how large a plight Iraqis have faced for years.

“I lost my son, who was the light of my life,” Mr. Hameed said. “So we say to the humanitarian people: Where is your humanity toward our children who are dying every day because of hunger and disease? My call is to the United Nations to save our children from this humanitarian crisis.”

At the refugee camp near Ramadi, word of the United Nations casualty report started circulating during the day, said one resident, Abdullah Awad, 55. The displaced Iraqis there have been desperately awaiting news that the United Nations can follow through with its plan to restart services in Ramadi, delivering more aid and helping with reconstruction once the city is deemed safe.

“Today we heard about this report, and we were happy because we felt that the world is with us, and we began to feel that the world is caring about us,” he said.

Civilians in Ramadi, which Iraqi forces took back from ISIS, were being moved to safer places. A U.N. report said nearly 19,000 people in Iraq were killed from January 2014 to October 2015.CreditKhalid Mohammed/Associated Press

“Even the obscene casualty figures fail to accurately reflect exactly how terribly civilians are suffering in Iraq,” the United Nations human rights chief, Zeid Ra’ad al-Hussein, said in a statement, which added that “countless others” had died from a lack of access to food, water and medical care.

The tragedy of Iraq is measured not only in lives lost but in the nearly complete societal breakdown of a country that is more divided than ever by sect and ethnicity, as Sunni Arabs, Shiite Arabs and Kurds pull further apart from one another.

Beyond the dead, there are the displaced people who are unable to find a place in their own country.

In the northern Kurdish region, Arab refugees fleeing the Islamic State are now mostly unwelcome, and sometimes pushed back to dangerous areas. In Kirkuk, a city where the Kurds took control after the Iraqi Army fled the Islamic State offensive in 2014, Arabs who have sought refuge from fighting have faced police raids and arbitrary arrests, the United Nations reported.

The Kurds, an ally of the United States in the fight against the Islamic State in Syria and in Iraq, have increasingly faced criticism from human rights organizations for their treatment of Arabs. Amnesty International, in a report also released Tuesday, said Kurdish forces in northern Iraq had destroyed thousands of Arab homes, “in an apparent effort to uproot communities in revenge for their perceived support for the so-called Islamic State.”

Video

The United Nations Human Rights Council said that low estimates figure that more than 18,000 people have been killed since January 2014 and roughly 3,500 are enslaved by the Islamic StatePublished OnJan. 19, 2016CreditCreditAssociated Press

Sunni Arabs displaced from Diyala Province have been prevented from returning to their homes by Shiite militias who have become the dominant authority. Sunnis who have fled Anbar Province, in the west, have been met with suspicion in Shiite-dominated Baghdad. Any Shiites who were not living in Baghdad or the south were long ago pushed out by the Islamic State.

The report tracked casualties through October, but violence has continued in Iraq since then. The study does not take into account intense fighting in recent months around Baiji, Sinjar or Ramadi — all former Islamic State strongholds. Nor does it take into account a surge in guerrilla-style attacks in Baghdad and Diyala Province, as the Islamic State has sought to keep a high profile despite losing territory.

In some cases, those attacks have led to revenge killings by Shiite militias. After a bombing last week on a cafe in Diyala that was claimed by the Islamic State and killed about two dozen people, militias sacked Sunni mosques, killing dozens, news agencies reported.

Some Sunni members of Parliament boycotted a session this week to protest the militias, which are linked to Iran and are only nominally under control of the Iraqi government.

To calm tensions, Prime Minister Haider al-Abadi on Tuesday visited Muqdadiya, the farming town in Diyala where the unrest occurred, and made a promise that he will surely be unable to keep, given the impunity with which the militias operate. “We will not allow the carrying of weapons outside the state structure,” he said.

At the camp near Ramadi, in the town of Habbaniya near a military base where American soldiers are training Iraqi forces, one of the men in charge, Duraid Saadi, said that after so much suffering, the people there were “psychologically broken.”

“This year, we have suffered a lot more than any other year, and our lives have become unbearable,” he said. “We have lost our houses and our money. We have lost everything. And when I speak with the displaced people, they say that we have had enough — that our lives have become hell.”

Nick Cumming-Bruce contributed reporting from Geneva.

A version of this article appears in print on , on Page A12 of the New York edition with the headline: U.N. Quantifies the Deep Suffering in an Iraq Divided and Under Attack. Order Reprints | Today’s Paper | Subscribe