Sgt. Eric M. Houck, 25, of Baltimore; Sgt. William M. Bays, 29, of Barstow, California; and Cpl. Dillon C. Baldridge, 22, of Youngsville, North Carolina, were all from the Army's 101st Airborne Division, headquartered at Fort Campbell, Kentucky.
The three plus a fourth U.S. soldier who was wounded came under fire in Peka Valley in Nangarhar province on Saturday.
The Afghan soldier who conducted the attack was killed in return fire, according to Attaullah Khogyani, a spokesperson for the governor of Nangarhar.
"Our thoughts and prayers are with the families of our soldiers who were killed and wounded," said Gen. John W. Nicholson, the commander of U.S. Forces Afghanistan, in a statement on Monday. "We will always remember our fallen comrades and remain committed to the mission they carried out and for which they ultimately gave their lives."
Insider, or so-called green-on-blue attacks, have been an ongoing threat to U.S. military personnel in Afghanistan, but the number has declined since 2012 because of new security procedures and better vetting of Afghan security forces.
The motivation for such attacks is sometimes unclear, with some resulting from personal conflicts and others from the Taliban's infiltration of the Afghan military.
ABC News' Luis Martinez contributed to this report.