Fighting is continuing in Kabul where militants have staged a wave of co-ordinated gun and rocket attacks.

Foreign embassies, Nato's HQ and the parliament were hit in the first major attack on Afghan capital in more than six months.

The attackers also struck in the provinces of Logar, Paktia and Nangarhar. The Taliban said it was the start of a "spring offensive" .

Two Afghan security force members and 17 militants were reportedly killed.

A further 17 Afghan police officers and nine civilians were injured, the Afghan interior ministry said.

Where was the intelligence to prevent co-ordinated attacks? Mirwais Yasini, MP from province of Ningarhar In pictures: Afghanistan attacks

The last attack on Kabul on this scale was in September 2011 when heavily armed insurgents took over an unfinished high-rise building and opened fire on the US embassy and Nato headquarters. That attack left at least 14 Afghans dead.

The Taliban said Sunday's attacks marked the start of a "spring offensive". Their "fighting season" tends to begin when the warmer weather melts snow in mountain passes along the border with Pakistan, allowing fighters to cross into Afghanistan.

Among Sunday's targets was the British embassy, with two rockets hitting a guard tower and a rocket-propelled grenade fired at a house used by British diplomats, but no staff were hurt, the Foreign Office later confirmed.

UK Foreign Secretary William Hague said he "strongly" condemned the attacks, and praised Afghan government forces for responding "bravely, promptly and effectively".

MP with Kalashnikov

Reports of explosions and gunfire in Kabul continued to come in 12 hours after the attacks began around 13:15 local time (08:45 GMT).

Insurgents still holding out in the city could be heard shouting "We will fight to death", Afghan officials told BBC News.

They are said to be fending off Afghan security forces with hand grenades and rocket-propelled grenades in the diplomatic quarter.

The attackers focused their assault on Western embassies in the central diplomatic area and around parliament but also attacked international troops in the east of the city.

The Taliban listed as targets the German and British embassies, the Kabul Star hotel, the headquarters of the Nato-led international force (Isaf), and parliament house.

Analysis The Taliban have said they are behind the attacks. Last week they warned that a new offensive would start soon. The last major attack in Kabul was last September when insurgents attacked. This is a large-scale attack, right in the heart of Kabul. Many questions remain unanswered. How did a large group of heavily armed insurgents, with a huge amount of weapons, manage to get inside Kabul and inside the central district of Wazir Akbar Khan? In their defence, Afghan intelligence officials say they did have prior intelligence about attacks on several locations in Kabul, which helped prevent bloodshed. But today's attacks have shattered the confidence of Afghans once more. The insurgents have once more shown that they can strike right in the heart of Kabul.

The list also included the ruined Darul Aman palace outside the capital.

A spokesman for the domestic security service, Lutfullah Mashal, said one of the targets was Afghan Vice-President Mohammad Karim Khalili.

But the attackers were captured before reaching Mr Khalili's home, he said.

At the parliament, a number of MPs joined the fight against the insurgents, Kandahar lawmaker Naeem Hameedzai Lalai said.

Speaking to the Associated Press news agency, he said he had climbed the tower of the parliament building and fired on insurgents with an assault rifle.

"I shot up to 400 or 500 bullets from my Kalashnikov at the attackers," he said. "They fired two rocket-propelled grenades at the parliament."

Large explosions rattled the diplomatic quarter where a Reuters correspondent spoke of black smoke rising from embassies as rocket-propelled grenades whizzed overhead.

Residents could be seen running for cover as sirens wailed. Some insurgents reportedly took up firing positions in a building under construction.

Mohammad Zakar, a 27-year-old mechanic who has a shop near a building commandeered by the militants, told AP he had seen two Land Cruisers pull up and two militants jumping out.

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

Afghan security officials told BBC News two "security guards" had been killed.

High-profile attacks on Kabul 15 April 2012: Seven sites including parliament, Nato HQ and foreign embassies attacked

13 September 2011: Gunman seize unfinished high-rise to fire on Nato HQ and US embassy

19 August 2011: Gunman storm British Council HQ, killing 12 people

Some damage was reported to the embassies of Germany and Japan but Russia denied reports that its mission had been hit "despite the close proximity of the fighting".

In eastern Kabul, in the Camp Warehouse area, a convoy of French troops returned fire after coming under attack.

Greek and Turkish troops manning a nearby base also came under heavy attack and responded with machine-guns, AP reports.

Afghan security forces captured two suicide bombers alive before they were able to reach their intended targets, according to Isaf.

Isaf said Afghan forces had taken the lead in repelling the attacks, which it dismissed as "largely ineffective" .

However, images from Kabul and the provinces appeared to show Isaf and US troops and aircraft in the area of fighting.

Late on Sunday, Kabul's police chief, Gen Ayub Salangi, told BBC News that fighting in the Camp Warehouse area had ended, but there was continuing violence both in the diplomatic quarter and close to parliament.

Provinces targeted

Eleven police officers and five civilians were wounded in Kabul while four insurgents were killed, police say.

Suicide bombers attacked a US air base near the eastern city of Jalalabad, capital of Nangarhar province.

Four civilians were wounded and seven insurgents were killed, police said. The dead reportedly include four suicide attackers dressed in burqas and women's clothes, who were shot dead while making an attack.

According to officials

In Logar, three police officers were wounded and three insurgents killed and one arrested

In Paktia, three police officers and five civilians were wounded and three insurgents killed after insurgents took over a building used by students in the provincial capital, Gardez

In the northern city of Kundoz, 15 suspected militants were arrested over an alleged plot to launch attacks

Mirwais Yasini, an MP from Nangarhar, told BBC News: ''This shows the Taliban don't want peace."

The MP said it was clear an intelligence failure had occurred.