The Trump administration refused again Friday to recognize Iraq's call to withdraw all U.S. troops, saying that any discussion with Baghdad would center on whatever force size the United States determines is sufficient to achieve its goals there.

"At this time, any delegation sent to Iraq would be dedicated to discussing how best to recommit to our strategic partnership — not to discuss troop withdrawal," the State Department said.

The statement came after Iraq's caretaker prime minister, Adel Abdul Mahdi, said he had asked Secretary of State Mike Pompeo during a Thursday telephone call to begin talks about a "mechanism" to implement last week's Iraqi parliamentary vote demanding the withdrawal of all foreign troops.

"He didn't quite characterize the conversation correctly," Pompeo, speaking at a news ­conference, said of Abdul Mahdi's description of the call.

"We are happy to continue the conversation with the Iraqis about what the right structure is," Pompeo said. But the United States would continue its mission of fighting against the Islamic State and training Iraqi security forces.

"As times change and we get to a place where we can deliver on what I believe and the president believes is our right structure with fewer resources dedicated to that mission, we will do so," he said.

The public disagreement between the United States and its Iraqi ally, imperiling the mission of more than 5,000 U.S. troops in Iraq to fight the Islamic State, reflects tensions that have characterized the relationship for years, as well as the deep schisms in Iraqi politics.

Successive administrations have pledged to strengthen Iraqi sovereignty, a goal that has focused on diluting the influence in Iraq of neighboring Iran. But direct U.S.-Iranian confrontation over the past few weeks has sharpened the position of Iraq's powerful Shiite Muslim political blocs and armed groups, which are leading calls for coalition troops to leave.

It began last month with an attack against a U.S. military installation in Iraq by a pro-Iran militia group that killed one American and wounded several soldiers. U.S. forces responded with airstrikes on militia forces near the Syrian border that resulted in 80 casualties. Outrage over what one Iraqi official called a "mother of all escalations" was quickly overshadowed by a militia-led assault on the U.S. Embassy in Baghdad.

President Trump then ordered a drone strike that killed Iranian Maj. Gen. Qasem Soleimani shortly after his arrival at Baghdad's airport Jan. 3, an action that led to the current firestorm. Two days later, at a parliamentary session boycotted by Sunnis and Kurds more supportive of the U.S. presence, Shiite-majority lawmakers voted to order Abdul Mahdi to "work to end the presence of any foreign troops on Iraqi soil and prohibit them from using its land, airspace or water for any reason."

Within hours, Trump said U.S. troops were not leaving and threatened sanctions against Iraq. He also demanded that Baghdad reimburse what he said were billions of dollars the United States had invested in a major Iraqi air base.

He later tempered that stance somewhat, telling reporters on Wednesday that "I'm only talking sanctions if we're not treated with respect."

The United States, Trump said during a meeting with the Greek prime minister, had done a "fantastic job" in Iraq, but "eventually we want to be able to let Iraq run its own affairs. . . . At some point, we want to get out. But this isn't the right point."

Iran's ballistic missile strike this week on bases housing U.S. forces in Iraq, in retaliation for the Soleimani killing, appeared to deepen the crisis, leaving fear rippling through a country that has repeatedly become the stage for proxy warfare between the two powers. Although the parliamentary vote was nonbinding, the initiative is gathering momentum in Baghdad, and the prime minister is under increasing pressure to see it through.

With tensions flaring, the administration has come to increasingly view Abdul Mahdi’s push to remove coalition troops as a clear decision to “take sides,” said Randa Slim, director of the Conflict Resolution and Track II Dialogues Program at the Middle East Institute.

“The impression here is that this Iraqi request is being done at the request of the Iranians and the prime minister is basically acting on their orders and acquiescing to their wishes,” she said.

Also killed in the strike on Soleimani’s convoy was the influential Iraqi leader of an Iran-backed militia, Abu Mahdi al-Muhandis, whose photographs now adorn monuments across Baghdad. Armed groups have threatened to avenge his death by targeting U.S. interests in Iraq.

In diplomatic meetings to quell the crisis, some foreign officials say, the tone of some Shiite leaders has been more muted. “In private, [they] are more practical and don’t want to see all forces go straight away because they know it would be destabilizing,” said one Western diplomat, who spoke on the condition of anonymity because of the sensitivity of the subject.

In his Friday statement, Abdul Mahdi said he had told Pompeo that American forces are entering Iraq and flying over its territory “without the permission of the Iraqi government . . . contrary to the agreements in force.”

Pompeo, he said, “promised to follow up.”

U.S. troops ended their combat mission, under a formal status-of-forces agreement, in 2011. Their return in 2014 was under a diplomatic note, by request of the Iraqi government after the Islamic State burst onto the scene and quickly took over major Iraqi cities and headed toward Baghdad.

Although the troops are part of an 81-nation coalition set up to fight the militants, the United States has by far the largest contingent, and other troops — including those sent by NATO members — would find it difficult to operate without U.S. capabilities.

Trump said last week that he wants NATO to take a bigger role in the region, and an alliance delegation met in Washington with administration officials on Friday. But some of the countries with the most forces — Britain has about 400 troops in Iraq, and Germany about 120 — remain unsure of what kind of arrangement the president has in mind.

Despite losing their self-declared caliphate, Islamic State fighters are regrouping and digging in for the long haul. U.S. military commanders say that a hasty coalition retreat could imperil efforts to contain the threat and risks seeing the group become more active.

“If there is another military escalation, it will be very hard to do what’s needed to get this on the right track, which is taking some time away from this to create space for diplomats on both sides to figure out a path forward, creatively, to suit both sides’ interests,” said Slim.

European countries are looking at what an alternative type of coalition presence might look like “to make sure that the gains against [the Islamic State] are not lost and that we continue to support the Iraqi security forces in their efforts,” the Western diplomat said.

Ideas on the table include a smaller force with a slightly different focus, in an attempt to restore trust damaged by the U.S. decision to launch unilateral airstrikes on Iraqi soil.

The accelerating debate over the foreign troop presence has breathed new life into months-long anti-government protests in Iraq. Demonstrators rallied in larger numbers on Friday than they had for weeks.

In Baghdad’s Tahrir Square, music blared and protesters held Iraqi flags aloft as they chanted in unison to reject attempts to turn their country into a political battleground. “We reject Iran, we reject the U.S., none of these people speak for us,” said Zahraa, 21, a student, as she pinned a message to a small stand. “Our country deserves a good morning,” it read.

More than 500 people have been killed in violence, with much of the bloodshed blamed on Iran-backed militias opposed to the protesters. Standing in a medical tent run by volunteer workers, Hassan al-Rubaie, 21, said the political class’s response to Soleimani’s death was an indication of the extent to which many lawmakers prioritized geopolitics over the sort of change that the movement has been fighting for.

“We’ve lost hundreds of martyrs, and not one politician went to grieve with the families,” he said. “Then Soleimani dies and the parliament turned out for his funeral.”

“We need politicians who are not beholden to either side.”

Asked whether he could name any, he said no.

Loveluck and Salim reported from Baghdad. Sarah Dadouch in Beirut contributed to this report.