A brazen, 18-hour Taliban attack on the Afghan capital ended today when insurgents in two buildings were overcome by heavy gunfire from Afghan-led forces and pre-dawn air assaults from US-led coalition helicopters.

Kabul awoke to a second day of explosions and heavy gunfire as troops worked to defeat the militants who had taken up positions in the buildings.

As darkness turned to dawn, forces fired one rocket-propelled grenade after another into a building in the centre of the city where militants began their attack yesterday in Kabul and three eastern cities.

Fighting there and at the Afghan parliament building on the south west side of the city ended just before 8am local time.

It was the Taliban's boldest and most complex assault in years.

Authorities said one police officer and at least 17 militants were killed in the multi-pronged attacks in Kabul and three eastern cities.

The Taliban began their near-simultaneous assaults on embassies, government buildings and Nato bases at 1.30pm yesterday, saying it was their response to Nato's recent claims that the uprising was weak.

The US, German and British embassies and some coalition and Afghan government buildings took direct and indirect fire, according to Lt Col Jimmie Cummings, a spokesman for the US-led coalition.

Residents near the parliament building said rocket-propelled grenades and gunfire rocked their neighbourhood throughout the night and into the morning.

Afghan Interior Ministry spokesman Sediq Sediqi said militants took up positions in a building under construction near parliament. Some MPs grabbed weapons and started fighting when militants fired on the parliament building yesterday.

Residents reported gunfire and explosions today, but Mr Sediqi said the militants' stand-off with Afghan security forces had ended.

Reporters for The Associated Press witnessed today's assault on another building under construction near the presidential palace, western embassies and Afghan ministries.

Shortly before 3am, coalition helicopters began flying over the building. At 4.23am, a cleric began calling Muslim worshippers to prayer over a loudspeaker in the area. During the next 15 minutes, troops launched five rocket-propelled grenades into the building. More followed.

By about 6.30am the blasts and shooting had stopped.

The first explosions yesterday rocked the diplomatic quarter of Kabul. Soon gunshots and rocket-propelled grenade fire were ringing out across the city. Smoke rose over the skyline as sirens wailed. A loudspeaker at the US embassy could be heard barking: "Duck and cover. Move away from the windows."

It was the most widespread attack in the Afghan capital since an assault on the US embassy and Nato headquarters last September blamed on the Haqqani network, a Pakistan-based insurgent group allied with the Taliban.

The sophistication and firepower of the latest strikes, as well as the high-profile government and foreign targets, bore the hallmarks of the attack last autumn and others carried out by Haqqani insurgents.

As in the earlier attack, armed insurgents took over half-built buildings yesterday and used them to fire down on nearby embassies and bases. In the streets of Kabul's Wazir Akbar Khan neighbourhood, where a Nato base and a number of embassies, including the US embassy, are located, residents scrambled for cover as gunfire rained down from all directions.

"I saw two Land Cruisers pull up and two militants jumped from the car," said Mohammad Zakar, a 27-year-old mechanic who has a shop near the building commandeered by the militants.

"They opened fire on an intelligence service guard ... They also fired and killed an Afghan policeman and then they jumped into the building. All the shops closed. I ran away."

Militants also attacked a Nato site on the outskirts of Kabul, where a joint Greek-Turkish base came under heavy fire and forces responded with heavy-calibre machine guns, according to an AP reporter at the scene.

A police officer said a suicide bomber inside a building near the base was shooting towards the Kabul Military Training Centre.

The eastern cities of Jalalabad, Gardez and Pul-e-Alam also came under attack, with suicide bombers trying to storm a Nato base, an airport and police installations.

Taliban spokesman Zabiullah Mujahid said dozens of suicide attackers and gunmen were involved in attacks that had been planned for two months to show the insurgency's power after Nato commanders called the Taliban weak and said there was no indication they were planning a spring offensive.

"We are strong and we can attack anywhere we want," Mujahid said, calling the attacks an opening salvo ahead of the yearly spring offensive, when warmer weather typically brings increased attacks.

Some international forces could be seen taking part in operations to secure and retake buildings in the capital - Nato troops embedded in Afghan units as "trainers" or "mentors". And two coalition helicopters were seen firing on the building in the centre of Kabul.

Explosions caused minor damage to the German embassy grounds, but no staff were injured, German foreign minister Guido Westerwelle said in Berlin.

The shooters appeared to be focusing on the nearby British embassy, which also suffered "limited damage", said Foreign Secretary William Hague. He said all staff were safe.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.