Secretary of State Mike Pompeo said the United States has “delivered” on its mission to oust al-Qaeda from Afghanistan and deter terrorist attacks plotted in the country and neighboring Pakistan.

The top diplomat’s upbeat message came ahead of a potential announcement of a peace deal between the United States and Taliban that has been tested by repeated Taliban bombings and is opposed by President Trump’s national security adviser.

In an interview published Wednesday with the Daily Signal, a news outlet affiliated with the conservative Heritage Foundation, Pompeo said American forces engaged in the United States’ longest war have been “successful” in achieving their original mission.

“If you go back and look at the days following 9/11, the objectives set out were pretty clear: to go defeat al-Qaeda, the group that had launched the attack on the United States of America from Afghanistan. And today, al-Qaeda . . . doesn’t even amount to a shadow of its former self in Afghanistan,” Pompeo told the Daily Signal.

“We have delivered,” Pompeo added.

Pompeo’s remarks come amid an increase in attacks against NATO service members in recent days, even as a State Department envoy announced that the United States and Taliban have reached an agreement “in principle” in peace negotiations. On Thursday, two NATO service members — an American and a Romanian — were killed in a suicide car bomb attack in Kabul at a checkpoint near NATO headquarters and the U.S. Embassy, the coalition said in a statement.

The agreement is expected to see the partial removal of U.S. troops in exchange for the Taliban renouncing al-Qaeda and preventing the group from recruiting, fundraising, training and other activities. But the Islamic State, a Taliban enemy, could play a complicating role as it becomes a greater threat in Afghanistan.

“While it’s true that the U.S. did achieve its initial goal of eliminating al-Qaeda sanctuaries in Afghanistan, it would be premature to proclaim ‘mission accomplished’ on the counterterrorism front in Afghanistan,” said Michael Kugelman, a South Asia expert at the Wilson Center. “To be sure, al-Qaeda has been degraded in a big way, but it remains resilient, and the newer threat of ISIS in Afghanistan is potent,” he said, using another name for the Islamic State.

The United States invaded Afghanistan on Oct. 7, 2001, less than a month after the terrorist attacks on the World Trade Center in New York and the Pentagon. Originally, the military incursion aimed to oust the Taliban and bring Osama bin Laden and al-Qaeda to justice. But the war has stretched on for 18 years through three U.S. presidencies, taking the lives of more than 2,300 Americans.

Since 2014, U.S. and NATO troops have been involved in an advisory mission to help Afghan troops. So far this year, 16 American troops have been killed, including three in recent weeks. That compares with 13 killed last year and 11 in 2017.

“There is a real achievement that has taken place, and we have in fact for now almost two decades greatly reduced the risk that an attack on the United States of America would emanate from Afghan soil, or for that matter from Pakistan, as well,” Pompeo said.

Pompeo paid tribute to the Americans who have fought in Afghanistan as well as in Iraq.

“For those who were engaged in our wars in Iraq or in Afghanistan, they took real risk, and they are to forever be considered special by me and by the American people,” he said.

According to Zalmay Khalilzad, the U.S. special envoy for Afghanistan, the draft calls for the withdrawal of U.S. troops from five bases across Afghanistan within 135 days of its signing. But he cautioned that final approval must come from Trump.

Last month, Trump said he plans to draw down the number of U.S. troops in Afghanistan to 8,600, and “then we make a determination from there as to what happens.”

U.S. officials also expect the agreement to advance talks between the Taliban and Afghan government, and an eventual cease-fire that would lead to a full U.S. and NATO withdrawal, possibly by the end of next year.

As the administration pursues a deal, Ryan Crocker, the U.S. ambassador to Afghanistan in 2011 to 2012, expressed concern about the Afghans who have worked with the United States throughout the conflict despite Taliban threats and violence.

“As part of any planning for a reduction in forces, the U.S. government has a responsibility to protect those who served the United States and who worked tirelessly at great personal risk to protect U.S. personnel and advance the U.S. mission,” he wrote in an op-ed last week.

Leaders at the State Department and Pentagon have not opposed Khalilzad’s efforts to reach a deal but have underscored the importance of keeping a counterterrorism capability in the country. National security adviser John Bolton, meanwhile, has strongly opposed the emerging deal, and he and his team have been sidelined from the policy process out of concerns they could leak unflattering information about the agreement.

“Pompeo’s comments appear to be telegraphing a desire for a troop withdrawal that would nonetheless ensure a continued and robust counterterrorism capacity,” Kugelman said. “This would align his position with Trump’s but put him at odds with other influentials in the administration that may think a withdrawal isn’t the right move at this point.”

About 14,000 U.S. troops are in Afghanistan now.