For three years, he worked closely with U.S. forces in Iraq. Now Ammar Younes sits in his frigid tent in a camp in Iraq’s Kurdish region, using a scalpel to gouge pieces of shrapnel out of his mangled legs as his young children look on.

A trainer in the Iraqi army, the 34-year-old was wounded when Islamic State extremists placed a bomb under his car in Mosul in June, just a week before the northern city fell to the militants. He was forced to flee his hospital bed, still wearing his medical gown, when the city was overrun.

Younes is one of more than 2 million Iraqis uprooted this year by the advance of the Islamic State, an exodus that has compounded this country’s massive displacement crisis.

About 1.7 million Iraqis fled their homes for other parts of the country from 2006 to 2008, the worst days of sectarian conflict after the U.S. -led invasion of 2003. Most have yet to return to their homes. Meanwhile, the war in neighboring Syria has spawned more than 3.2 million refugees, some of whom have sought shelter in Iraq.

The speed and scale of the latest Iraq crisis have stunned communities, international humanitarian organizations and the Iraqi government, which is poorly equipped to help displaced people as it fights a war against Islamist militants and struggles to balance its books amid diving oil prices­. Adding to the misery of the displaced, the winter has set in, sending temperatures below freezing.

Where displaced Iraqis have settled

Almost half of the Iraqis fleeing their communities this year have crowded into Iraqi Kurdistan, already home to more than 200,000 Syrian refugees.

With resources scarce, a scramble for survival is underway. The displaced say their sects, ethnicities and whether they have crossed an international border and legally qualify as refugees can determine their level of access to the scant aid available.

Younes has spent more than $2,000 on surgeries to remove shrapnel from his legs. But he said that he’s struggling to afford further care and that free clinics lack the specialized treatment he needs.

He complained that his plight is made worse by his being a Sunni Arab, like the Islamic State fighters, and thus deemed a security risk. He said he sometimes finds it difficult to get permission to leave the camp, even for medical treatment.

“We are at the bottom of the pile,” he said. “We are blamed for helping the terrorists, but we are the ones who have suffered most from them.”

Younes said he had been injured five times by extremists, including once when he was shot as he drove to work on a U.S. Army base, where he was a trainer for Iraqi officers. He said he never considered applying for a visa to go to the United States and still does not want to leave his country.

Sunni Arabs’ plight

Some of the displaced cannot make it into the semi­autonomous Kurdish region. Aid agencies say the Kurdish authorities have tightened entry, particularly for Sunni Arabs, since a suicide bombing killed five people in Irbil last month, a rare event in that part of Iraq. Kurdish officials claim the borders are open.

As Yazidi refugees driven out of their homes by Islamic State militants prepare for colder temperatures, aid agencies are struggling to provide for the displaced. (Reuters)

Those fleeing Mosul say checkpoints run by the Iraqi army or Shiite militias near Baghdad and Shiite provinces of the south also turn them away, leaving them with nowhere to run.

A Sunni Arab medical student from Mosul, who declined to give his name out of concern for his safety, spoke of fleeing the city this month only to be turned away at a checkpoint controlled by Kurdish peshmerga security forces­ near the city of Kirkuk. He decided to return home, despite fearing that he would be targeted by Islamic State militants for having left.

In some ways, Younes is one of the lucky ones, able to find a space on the edge of Irbil in a United Nations-administered camp that is home to 3,100 displaced people. Still, even there, the camp management was scrambling in mid-December to finish preparations for winter — distributing kerosene and extra plastic sheeting.

U.N. officials acknowledge that the assistance is insufficient. The U.N. response plan for displaced Iraqis remains only 31 percent funded, while the World Food Program has stopped procuring supplies for the displaced because of a lack of money. That means the distribution of boxes of food to families, the only assistance many get, will end by February unless emergency funding is found.

“It’s not that we can do more with less; it’s that we don’t have anything and the needs on the ground are immense,” said Barbara Manzi, the outgoing Iraq representative for the U.N. Office for the Coordination of Humanitarian Affairs, which is overseeing the organization’s response to the displacement crisis.

With so little relief available, families turn wherever they can for help. Displaced Christians get some additional assistance from local ­churches, but their independently administered camps are poorly equipped for winter.

Refugees vs. the displaced

“Whatever the church has, they give us — carpets, blankets, heaters, shampoo,” said Raja Mati, 35, who lives with 11 members of her extended family in a small plastic cabin with a tarpaulin roof erected in an unfinished Irbil shopping mall, still barely more than a construction site. Her husband finds occasional work as a day laborer to support their three children. “Still, life is so hard,” she said.

Ismail Mohammed, the assistant governor of Dahuk province, said that the Kurdish province, once one of the smallest in Iraq by population, is now the fourth-largest because of the influx of displaced people. He conceded that the Kurdish regional government has been able to provide little help as it wrangles with the central government in Baghdad over its budget. He hopes that will change as the country’s new prime minister, Haider al-Abadi, improves relations with the Kurdish authorities. He complained that the United Nations has been slow to act.

“The system is very famous for being slow,” he said. “They have to do a lot of paperwork.”

Not far from Mohammed’s office in the concrete shell of an unfinished building along the highway into Dahuk city lives Ismail Khalaf, a member of the minority Yazidi sect. He said he has not been able to find a space in a camp, even though 25 facilities of various sizes have been set up across Iraq since June to accommodate displaced people.

Khalaf, 49, crammed his 14 family members into his car and raced for safety when Islamic State fighters advanced on his village near Mount Sinjar in northern Iraq in August. A former translator for U.S. troops — he named his 5-year-old daughter Kevin after his male American team leader — he said he’s lucky to be alive after running into an Islamic State checkpoint while fleeing with his family. But he wishes he’d left for Syria rather than remaining in Iraq.

“It’s a lot better to be a refugee,” Khalaf said. “We are still strangers here, but we get nothing. At least, if someone visited sometimes and shook our hands and said, ‘We are trying to help,’ that would be something.”

Ironically, the legal situation of Iraqis in the country’s Kurdish region can be more problematic than that of people who have fled Syria. Lacking residency in the semi­autonomous north, Iraqis from elsewhere in the country are not authorized to work.

As a Syrian refu­gee, Karzan Hussein had no difficulty finding space in a camp in northern Iraq, despite arriving more recently than Khalaf. And the conditions for his family at Gawilan refu­gee camp are relatively good. The family’s tent is elevated on a concrete platform to prevent it from being flooded in winter rains, and every family has a brick kitchen and bathroom.

The muddled borders of the Middle East also mean that people pouring out of Syria — largely ethnic Kurds — often have more in common with their host community in northern Iraq than the Sunni Arabs who have fled to Iraqi Kurdistan from elsewhere in their own country.

Hussein said he initially escaped to Turkey after an Islamic State assault on his town in October. He then spent $350 for the nine members of his family to be smuggled into Iraq’s Kurdish region. “We came here because we are Kurds, [and] they are Kurds,” he said. “But it still feels like a prison. We are all refugees.”