Hundreds of Taliban insurgents have attacked army checkpoints in eastern Afghanistan and killed 21 soldiers in the deadliest single incident for the Afghan army in at least a year, officials said.
General Mohammad Zahir Azimi, a spokesman for the Defence Ministry, said "hundreds" of foreign and Afghan insurgents crossed the border to mount the attack, which took place in the remote and mountainous Ghazi Abad district of Kunar Province in the early morning on Sunday.
Mr Azimi did not specify which border, but Kunar lies next to Pakistan. It is a militant stronghold, and many Arab and other foreign insurgents are believed to operate there alongside the Afghan Taliban.
The Taliban claimed responsibility for the attack in an emailed statement, saying that one of their insurgents was killed and two were wounded.
The group has escalated attacks in recent months as it tries to take advantage of the withdrawal of foreign troops at the end of 2014.
Casualties among Afghan troops have been rising significantly since they took the lead in the war against the Taliban. Since the beginning of 2014, 84 Afghan army soldiers have been killed.
Mr Azimi said that 21 Afghan soldiers died and three others were wounded in the attack, which turned into an intense, four-hour gunbattle between the army and insurgents.
An army support unit en route to assist the operation also was targeted by a suicide bomber, he said, but there were no military casualties.
General Abdul Habib Sayedkhaili, chief of police for Kunar Province, said that there were around 30 Afghan soldiers manning the outpost when insurgents attacked from three sides with rocket-propelled grenades, mortars and light weapons.
He said that of seven soldiers initially reported missing, three had been found alive and security forces continued to search for the others.
It was not immediately clear if the soldiers had been kidnapped or had fled during the assault.
Hours after the attack, security forces were continuing to trade fire with the insurgents and chase them through difficult terrain, Mr Saeydkhaili said.
"Our security forces are going as far as they can to chase the enemy," he added.
While neither Mr Azimi nor Mr Sayedkhaili specifically mentioned Pakistan, the Afghan president appeared to point a finger at the neighbouring nation.
In a statement condemning the attack, Mr Karzai called on Pakistan to take serious measures to destroy terrorist sanctuaries and fight against terrorism.
Pakistan has a complicated relationship with the Taliban. It helped the group seize control of Afghanistan in 1996, and Kabul has repeatedly accused Islamabad of providing the insurgents sanctuary on its territory following the US-led invasion of Afghanistan in 2001.