ASADABAD, Afghanistan — Taliban insurgents overran an Afghan National Army base near here on Sunday morning, killing 21 soldiers in their bunks in what appeared to be the worst single blow to government forces since 2010, according to both government and insurgent officials.

President Hamid Karzai ordered an investigation and canceled a planned state visit to Sri Lanka in response to the attack, in the Ghaziabad district of Kunar Province, near the eastern border with Pakistan.

The attack highlighted the vulnerability of Afghan military units, which are generally no longer accompanied by American or other NATO advisers and do not have the close air support they often enjoyed. And it raised questions about the Afghans’ ability to hold out against the insurgents on their own as the NATO mission winds down and international forces prepare to leave Afghanistan at the end of 2014.

At the same time, there were new signals that efforts to start peace talks with the insurgents were foundering. In an unusual statement released Sunday, the Taliban acknowledged that it had suspended talks with the Americans aimed at a prisoner exchange: the release of five Taliban prisoners held at the Guantánamo Bay prison camp in exchange for the lone American prisoner of war held by the Taliban, Sgt. Bowe Bergdahl.