An Afghan National Army solider tells a local Afghan to put his arms out for a personnel search at a vehicle checkpoint in May 2013.

KABUL — An early morning attack by insurgents on two Afghan army checkpoints Sunday in Kunar province left 21 Afghan soldiers dead and six missing in a battle that lasted about four hours, the Afghan Defense Ministry said.

The Taliban claimed responsibility for the attack via an e-mailed statement, saying, “tens of (ANA) soldiers had been killed and arrested.”

The Afghan Defense Ministry said 21 Afghan soldiers were killed and two wounded and that the insurgents “suffered heavy losses.” The Taliban statement said only one of their fighters was killed and another wounded.

The attack took place in Ghazi Abad District in Kunar province, near the volatile border with Pakistan. The area has been a hotbed of insurgent activity throughout the war.

The defense ministry said both internal and foreign insurgents were involved in the attack, which began at 4 a.m. with the ensuing gunbattle lasting until 8 a.m.

An Afghan National Army unit that was dispatched to the area to assist was attacked by a suicide bomber, but there were no casualties in that incident, the ministry said.

The incident is believed to be one of the deadliest for Afghan National Army troops in at least a year.

With international troops drawing down ahead of the deadline for all coalition combat forces to be withdrawn by the end of 2014, the Taliban have stepped up attacks on the Afghan National Security Forces.

Casualties among Afghan forces have been on the rise, since they took over control of security last year. According to The Associated Press, 84 Afghan army soldiers have been killed since the beginning of this year.

Afghan President Hamid Karzai condemned the attack “in the strongest possible terms.” He was “deeply saddened by the tragedy,” and praised “the brave soldiers who lost their lives,” according to a statement on the presidency’s website. Karzai postponed a planned trip to Sri Lanka in the wake of the attack, according to the statement.

The statement said Karzai called on Pakistan to cooperate with Afghanistan and to take “serious and effective measures in eliminating the terrorist sanctuaries that have continued to pose a grave and serious threat” to both countries.

Zubair Babakarkhail contributed to this report.