Thousands of jihadi fighters from the murderous ISIS terrorist group surrounded Baghdad Sunday and were prepared to mount an assault.

More than 10,000 of the fanatical barbarians had gathered outside the Iraqi capital, poised to take it by force, an Iraqi official told Britain’s Telegraph newspaper.

Sabah al-Karhout, president of the provisional council of Anbar Province, told the paper that the fighters had advanced as far as Abu Ghraib, a suburb.

He said Iraq needed US aid because the western part of the country had fallen largely under the control of ISIS.

In response, the United States called in Apache helicopters to keep Iraqi forces from being overrun by ISIS savages near Baghdad’s airport.

Army Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, said the militants had come within 15 miles of the airport and had overrun the Iraqis.

“It was a straight shot to the airport,” he told ABC’s “This Week.” “So we’re not going to allow that to happen.”

Also on Sunday, three suicide bombings killed 58 people, many of them Kurdish security forces, in Qara Tappah, northeast of Baghdad. And a roadside bomb killed Anbar Province’s police chief and six civilians.

Secretary of State John Kerry said Sunday that while US-led strikes would weaken ISIS, it was ultimately up to the Iraqis to fight the group off.

“It is Iraqis who will have to take back Iraq. It is Iraqis in Anbar who will have to fight for Anbar,” he said.

Later Sunday, Turkey offered support to the campaign against ISIS by finally granting the US access to its air bases.

Sen. John McCain, however, said the US was failing to stop the jihadist onslaught and needed to ramp up airstrikes as the militants battled to seize the Syrian border city of Kobani.

“They’re winning, and we’re not,” he told CNN’s “State of the Union.” “There has to be a fundamental re-evaluation of what we’re doing because we are not degrading and ultimately destroying ISIS.”

ISIS’s advance on the largely Kurdish city of Kobani has sent 200,000 residents fleeing.

Kerry said the US-led coalition must act to stop it.

With Post Wire Services