No details surrounding the circumstances of their deaths have been provided by the military.
The killings occurred a day after US Secretary of State Mike Pompeo visited the Afghan capital of Kabul, where he said Washington was hopeful of a peace deal before 1 September.
Wednesday's US military statement announcing the killings said the identities of the soldiers would not be released until their families had been notified.
It was not clear if the deaths were the result of the war, which at nearly 18 years is America's longest-running.
More than 2,400 US service personnel have died in Afghanistan since the US-led coalition invaded in October 2001 to oust the Taliban and hunt down Al Qaida chief Osama bin Laden in the wake of the September 11 attacks.
He will begin a fresh round of direct talks with the Taliban on Saturday in the Middle Eastern state of Qatar, where the insurgents maintain a political office.
Mr Khalilzad has also held a series of meetings in Kabul in an effort to restart Afghan-to-Afghan talks that would also include the Taliban.
Before leaving Afghanistan for India on Tuesday, Mr Pompeo underscored Mr Khalilzad's strategy in the talks, which involves four interconnected issues: counter-terrorism, foreign troop presence, inter-Afghan dialogue and a permanent ceasefire.
Mr Pompeo added that discussions with the Taliban have also begun on US troop withdrawal:
"While we've made clear to the Taliban that we're prepared to remove our forces, I want to be clear we've not yet agreed on a timeline to do so."