The United States’ top military officer told American troops on a surprise visit to Baghdad yesterday that the momentum in the battle with Islamic State was “starting to turn”, but predicted a drawn-out campaign lasting several years.

General Martin Dempsey, chairman of the Joint Chiefs of Staff, was visiting Iraq for the first time since President Barack Obama responded to Islamic State advances this summer by ordering troops back into a country they left in 2011.

Hours earlier, an Iraqi army colonel said security forces appeared close to retaking the country’s biggest refinery at Baiji, which has been under siege for months by Islamic State militants.

Obama last week authorised roughly doubling the number of American ground forces as the military expands the reach of its advisers after slowing the militants’ advances with US airstrikes.

Dempsey told the troops the US military had helped Iraqi and Kurdish forces “pull Iraq back from the precipice”.

Islamic State has captured swathes of territory in both Iraq and Syria

“And now, I think it’s starting to turn. So well done,” Dempsey told a group of marines at the US embassy in Baghdad. Reuters accompanied him on the trip.

Islamic State has captured swathes of territory in both Iraq and Syria, where the US is also conducting air strikes with its allies in pursuit of Obama’s declared objective to “degrade and destroy” the militants.

Dempsey said it had been crucial to show Islamic State was not an unstoppable, 10-foot-tall force and instead “a bunch of midgets running around with a really radical ideology”.

He was hardly triumphant, however. Earlier, he visited a Joint Operations Center and watched a live video feed of a location showing the Islamic State’s black flag waving.

Thirty-six people were kidnapped by Islamic State in western Iraq yesterday, security sources said, members of the same tribe massacred in the hundreds by the group recently.

Dempsey repeatedly made the point that military force could not root out Islamic State unless Iraq’s government manages to work across the Sunni-Shi’ite divide. Building trust would take time. So would the US mission, he said.

“How long? Several years,” said Dempsey.

Dempsey, who also met top Iraqi officials, told Reuters he wanted to find out whether the Iraqis believed they could win recruits for a programme the US hopes to get under way next year to re-train Iraqi units.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.