Hamid Karzai, the Afghan president, has said intelligence failure allowed the Taliban to carry out the latest attacks in Kabul and elsewhere in the country.
"The terrorists' infiltration in Kabul and other provinces is an intelligence failure for us and especially for NATO and should be seriously investigated," Karzai said in a statement on Monday.
The president however, praised the "bravery and sacrifice of the security forces who quickly and timely reacted to contain the terrorists".
In his first reaction after the series of attacks targeting Western embassies and NATO bases, which continued till Monday morning, Karzai said that "Afghan security forces proved to the people that they can defend their country successfully".
Gun battles between Afghan security forces and Taliban fighters in the capital, Kabul, ended after almost 18 hours of fierce fighting, according to government and police officials.
"The latest information we have about the Afghan parliament area is that the attack is over now and the only insurgent who was resisting has been killed," Hashmatullah Stanikzai, the Kabul police chief's spokesman, said on Monday.
There were conflicting reports regarding the number of casualties in the co-ordinated attacks that targeted mainly western installations in Kabul, which the Taliban described as the launch of a "spring offensive".
Afghanistan's defence ministry said 32 gunmen and three Afghan soldiers were killed in the operation against the multiple assaults, Reuters news agency reported.
But Bismillah Mohammadi, the Afghan interior minister, said 36 fighters, eight members of security forces and three civilians were killed and 44 others wounded in the gun battle, the AFP news agency reported.
Al Jazeera's Bernard Smith, reporting from Kabul, said: "They [Taliban] have been able to strike right in the heart of the city, supposedly the most well protected part of Afghanistan."
"There are now of course, serious questions about intelligence failings that allowed the Taliban to effectively lay siege of the city for almost 18 hours," he said.
The Afghan capital awoke on Monday to a second day of explosions and heavy gunfire as a joint operation by Afghan and international forces worked to defeat the fighters holed up in one building in the heart of the city and another near the Afghan parliament.
Afghan-led forces fired one rocket-propelled grenade after another into a building in the centre of the city, where gunmen began the co-ordinated attacks on Sunday in the capital and three eastern cities.
Janan Mosazai, Afghan foreign ministry spokesman, said: "It is nearly impossible to stop all attacks by terrorists who continue to have sanctuaries and receive ideological, financial and logistical support outside Afghanistan."
"We will continue to fight the terrorists who pose a threat and danger to Afghanistan’s security and stability and its young democracy," he said.
"At the same time we will continue to pursue peace efforts with armed opposition groups, including the Taliban and other groups.
"And for that we are engaging not only leaders within the Taliban and other opposition groups, but also countries in the region, particularly the Islamic Republic of Pakistan."
The attacks on Sunday, which targeted embassies, government buildings and NATO bases, underscored the security challenge facing Afghan security forces as their US and NATO allies plan to leave by the end of 2014.
These were the the worst attacks in the capital since the Taliban was overthrown 11 years ago.
General Martin Dempsey, US military's top officer, told reporters there had been intelligence reports that indicated a potential threat from Haqqani militants, who exploit sanctuaries in neighboring Pakistan.
But the reports of a possible attack were "vague about timing," Dempsey said.
The Pentagon has blamed the Haqqani network for the attack but Dempsey said it was unclear if the attack could be traced back to Haqqani havens in Pakistan.
"The threat, you know, the Haqqani network exists on both sides of the border, so so we're not prepared to suggest this emanated out of Pakistan," he said.
A Taliban spokesman said the violence marked the start of their annual spring offensive which heralded the fighting season, adding that "a lot of suicide bombers" were involved.
|From the perspective of one neighbourhood in Herat
It said the main targets were the German and British embassies, and the headquarters of Afghanistan's NATO-led force, all in Kabul.
Bombers struck across Afghanistan in co-ordinated attacks, with explosions and gunfire shaking the diplomatic area of Kabul as Taliban fighters took over nearby buildings and tried to enter parliament.
The assault appeared to repeat the tactics of an attack in Kabul last September when fighters entered construction sites in several places to use them as positions for rocket and gun attacks.
Some legislators grabbed weapons and started fighting when gunmen fired on the parliament building.
On Monday morning, Al Jazeera's Smith reported from Kabul that police had been seen removing bodies from the site of an assault on Taliban attackers who had been holed up in a construction site next to the Kabul Star hotel.
Afghan security forces, who are responsible for the safety of the capital, were scrambling to reinforce areas around the so-called "Green Zone" diplomatic section of the city centre.