Two U.S. service members were killed during a military operation in eastern Afghanistan early on Wednesday morning, NATO said, the latest international casualties as the U.S. and the Taliban prepare for talks.

Their loss came just hours after U.S. Secretary of State Mike Pompeo made an unannounced visit to Kabul and outlined his hopes for a peace deal with the Taliban “before September 1.”

“In accordance with U.S. Department of Defense policy, the names of the service members are being withheld until 24 hours after notification of next of kin is complete,” NATO’s Resolute Support mission said.

The Taliban claimed in a statement they killed two American soldiers in an ambush in Sayed Abad district of southern Wardak province on Wednesday. There was no immediate confirmation or denial from NATO whether it was the same attack.

The blast brings to nine the number of US service members killed in Afghanistan so far this year, compared to 12 killed in all of 2018.

In his visit with President Ashraf Ghani, Pompeo said he hopes for a peace deal with the Taliban “before September 1”, speaking as he made his first visit to Kabul since Washington launched talks with the insurgents last year.

Pompeo met with President Ashraf Ghani as well as General Scott Miller, who leads NATO’s Afghanistan mission and the U.S. war effort in the country, as well as other high-level Afghan officials during the one-day visit to the Afghan capital.

Representatives from the United States and the Taliban are set to hold another round of discussions in Qatar later this week.

The talks have centered on four issues: counter-terrorism, the foreign troop presence, an intra-Afghan dialogue, and a permanent ceasefire.

U.S. officials have previously said they are hoping for a deal before the upcoming Afghan presidential elections, which have already been delayed twice and are now set for September.

President Donald Trump is currently planning to withdraw at least half of the 14,000 troops that remain in Afghanistan, which represent the majority of NATO’s force. Under recent plans drawn up by the Trump administration, all American troops will be withdrawn from Afghanistan over the next three to five years, in exchange for a deal that allows the current government in Kabul to share power with the Taliban.

Having broken out in October 2001, the war on terror in Afghanistan has come at an enormous cost for the United States, costing nearly $1 trillion or at least $3 billion per month, 2,278 U.S. military deaths, and a further 20,426 injuries.

AFP contributed to this report