“The service members came under fire during a train, advise and assist mission with our Afghan partners to clear a Taliban position and disrupt the group’s operations in Kunduz district,” the statement said.
It gave no details on the identity of the personnel or what units they served with, Reuters reported.
The deaths underline the precarious security situation around Kunduz, which Taliban fighters managed to enter last month, a year after they briefly captured the city in their biggest success in the 15-year long war.
Although U.S. combat operations against the Taliban largely ended in 2014, special forces units have been repeatedly engaged in combat, providing assistance to Afghan army and police.
Thousands of U.S. soldiers remain in Afghanistan as part of the NATO-led Resolute Support training and assistance mission and a separate counterterrorism mission.
The deaths come a month after another U.S. service member was killed on an operation against Islamic State fighters in the eastern province of Nangarhar.
Afghan forces, fighting largely alone since the end of the international combat mission, have suffered thousands of casualties, with more than 5,500 killed in the first eight months of 2016.