The two were killed "while conducting an operation," according to a statement from NATO's Resolute Support.
They have been identified as Spc. Joseph P. Collette and Sgt. 1st Class Will D. Lindsay.
Collette, 29 of Lancaster, Ohio, was with a bomb disposal unit and Lindsay, 33 of Cortez, Colorado, was a Green Beret.
They are the third and fourth U.S. service members killed in Afghanistan this year.
Sgt. Cameron Meddock, 26, was shot during a fire fight on Jan. 13, 2019, in Jawand District, Badghis Province, Afghanistan. The Texas native later died at a U.S. military hospital, Landstuhl Regional Medical Center, in Germany.
Staff Sgt. Joshua Beale, the second U.S. death in Afghanistan this year, came nine days later when he was killed by hostile fire in Tarinkot, Uruzgan Province. The 32-year-old Green Beret was from Virginia and on his third tour of duty.
Patrick Shanahan, then-acting defense secretary, said on a trip to Afghanistan last month that he had not been directed to reduce troop numbers in the country. ABC News previously reported the U.S. would draw some 7,000 troops from the country -- half of the U.S. forces -- sometime in 2019.