Two US soldiers have been killed and two others injured in a roadside bombing in Afghanistan, the United States military has said.

The Taliban claimed responsibility for the attack, which an Afghan official said happened in the Dand district of Kandahar province in the south of the country.

The US military did not immediately identify those killed.

More than 2,400 US troops have been killed in Afghanistan since the invasion in 2001 following the 9/11 terror attacks. Another 20,000 have been wounded.

The latest attack comes amid stalled efforts to restart peace talks.

Trump makes surprise Thanksgiving visit to US troops in Afghanistan Show all 10 1 /10 Trump makes surprise Thanksgiving visit to US troops in Afghanistan Trump makes surprise Thanksgiving visit to US troops in Afghanistan Donald Trump laughs with US troops after serving them Thanksgiving dinner at Bagram airbase during a surprise visit to Afghanistan AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan It was the president's first visit to Afghanistan AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan As is traditional with senior politicians, he was happy to help serve the troops – his vice-president Mike Pence did the same for US forces in Iraq a few days earlier AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan Mr Trump gets stuck in. He told troops he had only been able to have a mouthful of mashed potatoes – and no turkey – before being dragged off to address them AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan The president applauds as his Afghan counterpart Ashraf Ghani addresses troops AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan Mr Trump said that he was willing to restart talks with the Taliban REUTERS Trump makes surprise Thanksgiving visit to US troops in Afghanistan He told US troops: "The Taliban wants to make a deal. And we are meeting with them and we say it has to be a ceasefire and they didn't want to do a ceasefire and now they want to do a ceasefire, I believe. It will probably work out that way." AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan Mr Trump was accompanied on his trip by his national security adviser, Robert O'Brien. While it was his first trip to Afghanistan since becoming president in January 2017, he has been to a warzone once before when he visited troops in Iraq AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan The president told troops that he had flown 8,331 miles to be there to tell them the US has never been stronger. He said: "There is nowhere I'd rather celebrate Thanksgiving." AFP via Getty Images Trump makes surprise Thanksgiving visit to US troops in Afghanistan Mr Ghani and Mr Trump holding talks at Bagram airbase. Tens of thousands of Afghan civilians and more than 2,400 American service members have been killed since America's longest war began 18 years ago AP

In November Donald Trump made a surprise Thanksgiving visit to US troops at Bagram airbase, his first trip to Afghanistan.

While there he held talks with Ashraf Ghani, the Afghan president, and said he was looking to hold talks with the Taliban, three months after abruptly declaring that he had withdrawn a previously unannounced invitation to Taliban leaders to meet him at Camp David, the presidential retreat in Maryland.

That followed the killing of a US soldier in a Taliban attack.

He said: "We say it has to be a ceasefire and they didn't want to do a ceasefire and now they want to do a ceasefire, I believe. It will probably work out that way."

At the time the Taliban said it was interested in holding talks.

Last week there were reports that the radical Islamist group was discussing a possible ceasefire, which the US peace envoy, Zalmay Khalilzad, has been pressing for.

A break in fighting would give a window in which the US and the Taliban could then forge an agreement to withdraw all of America's troops.

However, the latest US military deaths will provide a fresh obstacle to the resumption of talks.