With his boss having banned Iraqi citizens from entering the US and threatening to seize its oil, Jim Mattis’s goodwill visit to Baghdad was always going to be a tough sell.

But within hours of arriving in the Iraqi capital on Monday, the US defense secretary had told senior officials that the US would do neither, brushing aside earlier suggestions by Donald Trump that had strained already fraught ties on the eve of the most decisive phase of the war against Islamic State.

“I think all of us here in this room, all of us in America, have generally paid for our gas and oil all along, and I’m sure that we will continue to do that in the future,” Mattis told reporters traveling with him. “We’re not in Iraq to seize anybody’s oil.”

Iraqi officials said the former US Marine Corps general’s assurances were well received by his hosts who, like other regional leaders, had started to focus less on the US president’s pronouncements and more on his envoys’ deeds.

The offensive to retake the western half of Mosul continued to move slowly on Monday as Mattis met with senior Iraqi leaders and US officers to map out a US role in a battle that is thought likely to take at least two months.

Throughout the past two years, which have seen the terror group lose most of its territory in Iraq, US airstrikes and artillery have systematically picked off key Isis targets, while Iraqi troops have led the ground fight. That equation is unlikely to change as the final battle for Isis’s last urban stronghold draws near.

“The US forces will continue in the same role as they did in east Mosul. I need to get current on the situation,” Mattis told reporters in Iraq. “And the only way you can do this is talking to the people on the ground.”

Since the US joined the war against Isis in Iraq in August 2014, military cooperation has reached levels not seen since the US invasion 11 years earlier, officials from both sides have said. However, trust on the ground has often failed to match that shown in war planning rooms, with Iraqi troops frequently complaining that the US has not acted quickly enough to defeat a mutual foe, which had at one point seized five cities and more than one third of the country’s territory.

“They could have wiped them out in a weekend if they wanted to,” said Mudher al-Saade, a corporal from Baghdad, who is staged to the south-west of Mosul. “Instead, it has taken two and a half years to get this far. Why is that? Who do they want to help?”

A conspiracy theory that the US benefits from the presence of Isis, or played a direct role in creating the group, has broad currency among some Iraqi fighting forces, particularly the popular mobilisation units (PMUs), an umbrella group of paramilitaries, which was brought under the control of the government late last year.

The PMUs are not directly involved in the battle for Mosul, a grinding fight through fortified lanes and roads that lead straight to the Isis heartland. However, up to 50,000 militiamen have taken a blocking position to the west of Mosul, where they will attempt to stop Isis fighters from fleeing for the Syrian border.

National police and Iraqi army forces are making slow advances towards Mosul airport in the city’s south-west, which will be used as a staging point for the eventual assault on the city. Not far to the east from the airport is the Nour mosque, where the Isis leader, Abu Bakr al-Baghdadi, proclaimed the existence of a caliphate, with him as leader, in mid-2014. Ever since, Isis had made Mosul one of its two main centres of operation – the other being Raqqa in Syria.

Iraqi officials told the Guardian they were confident of continued cooperation if Donald Trump played no direct role in how the war was run and if other senior officials, and institutions, continued to show independence.

“What the courts did in overturning that ban restored faith,” said one senior Iraqi official. “I think even Americans know that they have elected a fool. It is unusual to be ignoring a president but that’s the new world we live in.”

Muhannad al-Shumari, a dental technician from Baghdad, said: “I didn’t believe Trump. He just said that for his supporters. Nobody would accept [what he said]. No Iraqi politician can allow him to do this, even if they’re all corrupt. They believe Jim Mattis.”

Additional reporting by Salem Rizk