(Adds Kadhimi remarks)
By Steve Holland and Trevor Hunnicutt
WASHINGTON, July 26 (Reuters) - U.S. President Joe Biden and Iraqi Prime Minister Mustafa al-Kadhimi sealed an agreement on Monday formally ending the U.S. combat mission in Iraq by the end of 2021, but U.S. forces will still operate there in an advisory role.
The agreement comes at a politically delicate time for the Iraqi government and could be a boost for Baghdad. Kadhimi has faced increasing pressure from Iran-aligned parties and paramilitary groups who oppose the U.S. military role in the country.
Biden and Kadhimi met in the Oval Office for their first face-to-face talks as part of a strategic dialogue between the United States and Iraq.
"Our role in Iraq will be ... to be available, to continue to train, to assist, to help and to deal with ISIS as it arises, but we're not going to be, by the end of the year, in a combat mission," Biden told reporters as he and Kadhimi met.
There are currently 2,500 U.S. troops in Iraq focusing on countering the remnants of Islamic State. The U.S. role in Iraq will shift entirely to training and advising the Iraqi military to defend itself.
The shift is not expected to have a major operational impact since the United States has already moved toward focusing on training Iraqi forces.
Still, for Biden, the deal to end the combat mission in Iraq follows decisions to carry out an unconditional withdrawal from Afghanistan and wrap up the U.S. military mission there by the end of August.
Together with his agreement on Iraq, the Democratic president is moving to formally complete U.S. combat missions in the two wars that then-President George W. Bush began under his watch nearly two decades ago.
A U.S.-led coalition invaded Iraq in March 2003 based on charges that then-Iraqi leader Saddam Hussein's government possessed weapons of mass destruction. Saddam was ousted from power, but such weapons were never found.
In recent years, the U.S. mission was focused on helping defeat Islamic State militants in Iraq and Syria.
"Nobody is going to declare mission accomplished. The goal is the enduring defeat of ISIS," a senior administration official told reporters ahead of Kadhimi's visit.
The reference was reminiscent of the large "Mission Accomplished" banner on the USS Abraham Lincoln aircraft carrier above where Bush gave a speech declaring major combat operations over in Iraq on May 1, 2003.
"If you look to where we were, where we had Apache helicopters in combat, when we had U.S. special forces doing regular operations, it's a significant evolution. So by the end of the year we think we'll be in a good place to really formally move into an advisory and capacity-building role," the official said.
U.S. diplomats and troops in Iraq and Syria were targeted in three rocket and drone attacks earlier this month. Analysts believed the attacks were part of a campaign by Iranian-backed militias.
The senior administration official would not say how many U.S. troops would remain on the ground in Iraq for advising and training. Kadhimi also declined to speculate about a future U.S. drawdown, saying troop levels would be determined by technical reviews.
Kadhimi, who is seen as friendly to the United States, has tried to check the power of Iran-aligned militias. But his government condemned U.S. air strikes against Iran-aligned fighters along its border with Syria in late June, calling it a violation of Iraqi sovereignty.
In remarks to a small group of reporters after the talks, Kadhimi stressed that his government was responsible for responding to such attacks. He acknowledged that he had reached out to Tehran to address them.
"We speak to Iranians and others in an attempt to put a limit to these attacks, which are undermining Iraq and its role," he said.
The United States plans to provide Iraq with 500,000 doses of the Pfizer/BioNTech COVID-19 vaccine under the global COVAX vaccine-sharing program. Biden said the doses should arrive in a couple of weeks.
The United States will also provide $5.2 million to help fund a U.N. mission to monitor October elections in Iraq.
"We're looking forward to seeing an election in October," said Biden. (Reporting By Steve Holland and Trevor Hunnicutt; additional reporting by Phil Stewart; editing by Grant McCool and Raju Gopalakrishnan)
Our Standards: The Thomson Reuters Trust Principles.