An Afghan soldier shot and killed two U.S. soldiers and wounded two more outside a top-security prison near Kabul Sunday, a U.S. military spokesman said.

The gunman was shot dead by other Afghan troops at Pul-e-Charkhi prison, 20 miles east of Kabul, said Maj. Sheldon Smith, a spokesman for the Combined Security Transition Command, a body that trains and mentors Afghan security forces.

The Americans were providing external security for the prison when they were shot, Smith said. U.S. and Afghan authorities were trying to determine the motive for the attack, he said.

"All indications are" that the shooter was a member of the Afghan National Army, Smith said.

• More coverage is available in FOXNews.com's Afghanistan center.

"The ANA are our partners here and they are working side-by-side with us in conducting this investigation," Smith said.

Meanwhile, a roadside bomb killed five police and wounded two others on Sunday in eastern Afghanistan, while a clash in the west left eight police and at least four suspected militants dead, officials said.

The latest violence comes amid an escalation in spring attacks and military operations after a winter lull.

A remote-controlled mine blew up as a police convoy was passing, killing five officers and wounding two others in the Chola district of eastern Ghazni province, said deputy governor Qazim Allayar.

In western Farah province, insurgents ambushed a police convoy on Saturday in Bakwa district, and the ensuing six-hour gun battle left eight police and at least four suspected militants dead, said police chief Gen. Sayed Aqa Saqib.

Intelligence reports indicate that 17 suspected militants were killed or wounded in the clash, but only four bodies of the insurgents remained at the scene after the gun battle, while others were removed by the attackers, Saqib said. Two other policemen were wounded, he said.

Saqib said that two of the dead insurgents had come from neighboring opium-producing Helmand province, where a large NATO operation is under way to root out militants.

Visit FOXNews.com's Afghanistan center for complete coverage.