WASHINGTON — President Obama said Thursday the humanitarian crisis atop a barren hill in northern Iraq is over, eliminating the need for a risky U.S. rescue mission. But Iraqis elsewhere face a “dire” threat from an advancing Islamic army, he said.

Obama said the U.S. will work with other governments to provide humanitarian relief “wherever we have capabilities” and can effectively reach those in need, even as U.S. warplanes continue a limited, defensive campaign of airstrikes. Hundreds of thousands of Iraqis have been driven from their homes since June as the militants seized swaths of territory in northern Iraq.

A U.S. military and civilian team of 16 people spent Wednesday atop Sinjar Mountain in northern Iraq, to assess conditions and see how many Iraqis needed to be evacuated. They reported that the number of trapped Iraqis was about 4,000 — far fewer than anticipated -- and that U.S.-supplied food and water had reached many of those in need in recent days.

Obama said the U.S. had delivered 114,000 meals and 35,000 gallons of water to the Iraqis, who were faced with almost certain death at the hands of the Islamic State group if they descended the mountain and possible starvation if they stayed atop Sinjar.

“The bottom line is, is that the situation on the mountain has greatly improved and Americans should be very proud of our efforts,” Obama said, speaking from his vacation spot in Edgartown, Massachusetts. “We broke the ISIL siege of Mount Sinjar, we helped vulnerable people reach safety and we helped save many innocent lives.”

ISIL refers to the militant group known as the Islamic State of Iraq and the Levant, or simply the Islamic State. It is an al-Qaida inspired extremist group that controls much of northern and western Iraq and aspires to create a caliphate in Iraq and neighboring Syria.

The United Nations on Wednesday declared the situation in Iraq a “Level 3 Emergency” — a development that will allow for additional assistance to the displaced, said U.N. special representative Nickolay Mladenov, pointing to the “scale and complexity of the current humanitarian catastrophe.”

Rear Adm. John Kirby, the Pentagon press secretary, said prior to Obama’s remarks that U.S. officials believe the number of trapped Iraqis on Sinjar is now “in the neighborhood of 4,000,” and that between 1,500 and 2,000 of those are locals who have no plans to leave.

“We believe based on our assessment of conditions on the mountain that it is much less likely that we’ll need to continue to airdrop any more food and water,” Kirby said. The last airdrop was Wednesday.

That does not, however, substantially change the big picture in Iraq, which is in crisis with a problem-plagued government and an aggressive Sunni insurgency.

The Obama administration has been airdropping food on the mountain and had contemplated a military-led rescue of civilians who fled there to escape the militant group known as the Islamic State. But it had been unclear how many people might need evacuation. Some had reported them to number in the tens of thousands.

After being briefed on the assessment team’s trip to Sinjar Mountain, Defense Secretary Chuck Hagel said Wednesday that it was “far less likely” now that a rescue mission would be needed.

Hagel called the assessment a bit of good news. Of the U.S. effort in Iraq, he said: “It’s not over. It’s not complete.”

Attacks across Iraq’s north and west by the Islamic State and its Sunni militant allies this summer have displaced members of the minority Christian and Yazidi religious communities and threatened neighboring Iraqi Kurds in the autonomous region.

Thousands of Yazidis on the mountain were able to leave each night over the last several days, Kirby said in a statement Wednesday.