The Pentagon has identified the three soldiers killed in eastern Afghanistan on Saturday.

The soldiers were gunned down in an apparent insider attack by an Afghan soldier, according to Afghan authorities and U.S. officials. The incident is under investigation, the Pentagon said in a statement Monday.

Sgt. Eric Houck, 25; Sgt. William Bays, 29; and Cpl. Dillon Baldridge, 22, all belonged to the 101st Airborne Division and were killed in Nangahar Province, according to the statement. Another soldier was wounded in the attack, and the gunman was killed.

Afghan soldier opens fire on U.S. troops, killing three servicemen

Houck was from Baltimore; Bays was from Barstow, Calif.; and Baldridge was from Youngsville, N.C. Their deaths bring the total number of U.S. troops killed by hostile fire in Afghanistan in 2017 to six.

Baldridge’s last public post on Facebook was on May 5, talking about how the end of his deployment was approaching. His friend, Bill Walsh, who served with him, described Baldridge in a short text exchange, as “the best of all of us.”

“If there was ever somebody who had to go, he would volunteer,” he added.

Since the war began in 2001, 1,879 U.S. service members have died from enemy fire, according to the website iCasualties.org.

The three were slain Saturday on a firebase in the Pekka Valley near Nangahar’s Achin district where U.S. forces have been battling Islamic State militants for months. The Taliban, however, took credit for the attack. In a statement to journalists, a spokesman from the militant group called the gunman an “infiltrator.”

“There was a joint operation, there were some advisers also present when the attacker opened fire on them,” Afghan Defense Ministry spokesman Mohammad Radmanesh said. “We are unable at this stage to say if the soldier was a commando or an infiltrator.”

Saturday’s attack marks the second insider attack in Afghanistan in 2017. In March, three soldiers were wounded when an Afghan soldier opened fire within the confines of a U.S. Special Operations base in Helmand Province.

At their height in 2012, insider attacks accounted for 15 percent of the U.S.-led coalition’s deaths in Afghanistan, according to data compiled by the Long War Journal. The rash of deaths prompted U.S. forces to incorporate new measures, including sending armed personnel to monitor any event where U.S. and Afghan troops worked together while on base. Since then and as U.S. troops have steadily pulled out of the country, insider attacks have rapidly declined.

In the past, the Taliban claimed responsibility for nearly every death caused by so-called friendly Afghan troops, though at the time U.S. and NATO officials said only a quarter of the deaths were orchestrated by the militant group.

Sayed Salahuddin contributed to this report from Kabul.

Anger and sorrow grip Kabul after devastating bombing in diplomatic zone

More U.S. soldiers may be heading to Afghanistan. That might not solve the problem.

Some in Afghanistan question U.S. choice to use 22,000-pound bomb against ISIS

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news