IRBIL, Iraq — The arrival of elite Iraqi troops backed by heavy coalition airstrikes has halted a major Islamic State offensive to capture the city center of Ramadi, one of the last bastions of government control in Iraq’s Anbar province, and to seize the oil refinery at Baiji.

But the inability of rank-and-file security forces to hold on to territory without outside assistance is raising doubts among U.S. officials and other Western advisers about the long-term stability of the area. They note that the same set of Iraqi special forces and coalition airstrikes have played outsized roles in recent Iraqi government campaigns in Tikrit, Ramadi and Baiji.

A senior Obama administration official, briefing reporters in Washington this week only anonymously, per administration policy, made note of the difficulties Iraqi troops still face in trying to roll back the Islamic State. Even though the Iraqi forces are showing signs of improvement, “we have a very, very long road ahead.” He said the administration thought “in terms of years,” not months, when it came to defeating the jihadists.

“ISIL remains a very adaptive enemy,” the official said, using the administration’s preferred acronym for the Islamic State. “They’re going to do things that surprise everybody. We expect that.”

After retaking Tikrit, Saddam Hussein’s hometown, which the Islamic State had controlled since last June’s collapse of much of the Iraqi army and police, Iraqi government officials hailed the victory a few weeks ago as the first step in a broad campaign to retake much of western, central and northern Iraq.

But within days it was clear that the highly organized and tactically adept militants had other plans. The Islamic State opened fronts in Ramadi, where it had had a presence for months, and Baiji, a city in central Iraq that’s the site of the country’s largest oil refinery. The cities are more than 120 miles apart, but the offensives were executed simultaneously and enjoyed early success.

At Ramadi, Iraqi security units essentially withdrew, triggering the flight of perhaps 100,000 civilians, while at Baiji, the Islamic State captured parts of the refinery that had remained in government hands after the militants stormed the facility last July.

Only the arrival at Ramadi of the Golden Brigade, one of Iraq’s three main elite special forces units, stopped the Islamic State gains. Even then, Iraqi government officials have admitted that the Islamic State still controls about a third of the city and a much larger percentage of the surrounding province.

An officer in the Anbar operations center, a facility the Islamic State almost overran last week, said the situation was well enough in hand that residents who’d fled could now return. “And as you can see from the news, most are returning, because the situation is normal,” according to the officer, who asked not to be identified, saying he wasn’t authorized to talk to a reporter.

Other people, however, said the return of Ramadi residents had more to do with the difficulty of gaining entrance to Baghdad, which requires the sponsorship of a resident, than with any belief that the Islamic State has been vanquished. Many found returning home, even to a conflict, more palatable than living in squalid tent cities erected on the outskirts of the capital in the suburb of Abu Ghraib.

There are only about 5,000 elite Iraqi troops, divided among the Golden Brigade, an Interior Ministry SWAT team and a third unit known as the Scorpions. They are spread thin responding to both offensives, Baiji and Ramadi. The question among military analysts is what happens when security is turned over again to regular army and police units, which are less well equipped and trained.

“It’s what the Yanks call ‘whack-a-mole,’ ” said one former British special forces soldier who advises the Kurdistan Regional Government. He agreed to speak only anonymously because he didn’t want to publicly criticize the central government in Baghdad. “The Baghdad government only has about 5,000 men worth (anything) in combat, so when they deploy they can usually handle the situation. But then they end up moved to the next hot spot, (and) Daash just attacks where they left.” Daash is an Arabic acronym for the Islamic State.

“Once they move these elite units out of Ramadi or Baiji, the same checkpoint army will be standing there without proper support, equipment or supplies, and they’ll run away at the first sign of trouble,” the adviser said. “And the elite units will have to come back.”

Hannah Allam in Washington and McClatchy special correspondents in Ramadi and Irbil, who cannot be named for security reasons, contributed to this report.

Prothero is a McClatchy special correspondent. Email: mprothero@mcclatchydc.com; Twitter: @mitchprothero