KABUL, Afghanistan — Taliban insurgents struck the heart of the Afghan capital and three eastern cities Sunday, firing automatic weapons and grenades at embassies, government buildings and NATO bases as they launched the spring fighting season with the boldest and most complex assault in years.
The multi-pronged attacks show the Taliban and their allies are far from beaten and underscored the security challenge facing government forces as US and NATO forces draw down. The majority of international combat troops are scheduled to leave by the end of 2014.
The first blasts rocked the diplomatic quarter of Kabul on Sunday afternoon, and 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.’’
One police officer and 17 militants were killed in the attacks, the most widespread 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. Fighting continued more than 12 hours after the first blasts, with explosions echoing into the night.
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 fall and others carried out by Haqqani insurgents.
As in the earlier attack, armed insurgents took over half-built buildings Sunday and used them to fire down on nearby embassies and bases. In the streets of Kabul’s Wazir Akbar Khan neighborhood, 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.’’
Across town at the parliament building, insurgents climbed to the upper floors of another empty building and fired on lawmakers below. A few legislators climbed on the roof of the parliament and fired back.
‘‘I shot up to 400 or 500 bullets from my Kalashnikov at the attackers,’’ said Mohammad Nahim Lalai Hamidzai, a lawmaker from Kandahar.
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-caliber machine guns. A police officer said a suicide bomber inside a building near the base was shooting toward the Kabul Military Training Center.
The eastern cities of Jalalabad, Gardez and Pul-e-Alam also came under attack, with suicide bombers trying to storm NATO bases.
Taliban spokesman Zabiullah Mujahid said dozens of suicide attackers and gunmen were sent into four provinces in an assault that had been planned for two months to show the extent of 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.
The near-simultaneous assaults were the latest blow to an international effort that has been on edge for months as distrust grew between international and Afghan forces following the release of a video purporting to show Marines urinating on Taliban corpses, as well as the burning of Qurans at a US base and a deadly attack by a US soldier that killed 17 Afghan villagers.
Those tensions had appeared to be subsiding in recent weeks and the relatively quiet start to spring had brought hope: a deal governing night raids, talks with the Hizb-i-Islami insurgent group and the appointment of a new head to the High Peace Council — which is trying to negotiate with the Taliban.
That quiet was shattered Sunday. More than a dozen explosions rocked Kabul and heavy gunfire crackled through the streets for hours.
At least one police officer was killed in Kabul, according to an AP photographer at the scene. Seventeen militant fighters also died, including four in Kabul, and two others were arrested, the Interior Ministry said. Seventeen police officers and 14 civilians were wounded in attacks across four provinces.
Lt. Col. Jimmie Cummings, a spokesman for the US-led coalition, said the US, German and British embassies and some coalition and Afghan government buildings took direct and indirect fire.
US Marine Gen. John Allen, the top commander of US and NATO forces in Afghanistan, said the coalition was standing by to support the Afghan forces, if needed but had not been called in.
‘‘I consider it a testament to their skill and professionalism — of how far they've come — that they haven’t yet asked for that support,’’ Allen said in a statement.
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.’’
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,’’ according to British Foreign Secretary William Hague. He said all staff were safe.
Mujahid said the Kabul attacks targeted NATO headquarters, the British and German embassies, the Afghan parliament building, two hotels, and other sites along Darulaman road, where the Russian Embassy is located.
US Ambassador Ryan Crocker said Sunday’s attacks showed why the US should not try to hasten the exit from Afghanistan.
‘‘To get out before the Afghans have a full grip on security, which is a couple years out, would be to invite the Taliban, Haqqani and al-Qaida back in and set the stage for another 9-11,’’ Crocker said.
At nearly the same time as the Kabul attacks, Taliban fighters launched assaults on Afghan and NATO installations in the capitals of Nangarhar, Logar and Paktia provinces.In Jalalabad, the capital of Nangarhar province, two groups of militants — some wearing burqas to disguise themselves as women — launched separate attacks on a military airfield used by NATO and Afghan forces, as well as a smaller NATO base nearby. The ministry said Afghan security forces gunned down all four of the militants.
‘‘There were lots of blasts,’’ said Abdul Qahar Safi, a resident of Jalalabad. ‘‘I came to take my children from the school.’’
In Logar province, south of Kabul, five militants occupied a building under construction and started firing, the ministry said. Three police were wounded when the insurgents, who were all shot and killed, threw hand grenades on policemen responding to the scene. Four civilians also were wounded in the attack.
Farther south in Paktia province, a group of armed insurgents — some wearing women’s clothes — entered a building near a police training center in Gardez. The ministry said the militants started firing in different directions. Three attackers were killed, and five civilians and three policemen were wounded.
The coordinated assaults showed a level of organization that was reminiscent of the last sustained attack in the heavily guarded capital in September.
In that strike, six fighters with heavy weapons took over an unfinished high-rise and fired on the US Embassy and NATO headquarters. They held out against a 20-hour barrage by hundreds of Afghan and foreign forces. By the time the fighting ended, insurgents had killed 16 Afghans — five police officers and 11 civilians.
That attack was blamed on the Pakistan-based Haqqani network, though Pakistan denied any involvement.
In a statement Sunday, Pakistani Foreign Minister Hina Rabbani Khar expressed concern over the latest attacks and said Pakistan condemns terrorism in all forms and has consistently encouraged dialogue to resolve issues in Afghanistan.
Associated Press writers Deb Riechmann, Patrick Quinn and Amir Shah in Kabul, Jill Lawless in London and Geir Moulson in Berlin contributed to this report.