KABUL — Four gunmen with pistols stuffed into their socks attacked a luxury hotel frequented by foreigners in Afghanistan’s capital Thursday, just hours after militants killed 11 people in an audacious assault on a police station in eastern Afghanistan.
All the assailants were killed in both standoffs, but made their point: Afghan forces face a huge challenge in securing upcoming elections in what will be a major test of their abilities as foreign troops wind down their combat mission at the end of this year.
The attacks show the Taliban are following through on their threat to use violence to disrupt the April 5 vote, which will be the first democratic transfer of power since the 2001 US-led invasion that ousted the Islamist militant movement. President Hamid Karzai is constitutionally barred from seeking a third term.
Taliban spokesman Zabihullah Mujahid claimed responsibility for the assault on the Serena hotel and the earlier attack in Jalalabad, an economic hub near the border with Pakistan.
‘‘Our people, if they decide to attack any place, they can do it,’’ he said.
The violence began before dawn Thursday when a suicide bomber blew up his explosives-laden car outside the police station in Jalalabad, near the residence of Nangarhar provincial Governor Attaullah Ludin.
Six gunmen rushed into the station as two more bombs exploded nearby — one hidden in a motorized rickshaw and another in a vegetable cart.
That prompted a fierce battle that lasted more than four hours, with Afghan police and soldiers chasing gunmen down the street amid gunfire. Security forces killed seven attackers, deputy Interior Minister General Mohammad Ayub Salangi said.
Police said the attack killed 10 officers, including a city district police chief, and a university student caught in the crossfire, and wounded 15 policemen.
The Taliban spokesman said the attackers wore suicide vests and killed nearly 30 police officers. The Islamic militant group exaggerates casualty figures.
The initial suicide bombing badly damaged the nearby state-run Afghan radio and television building, shattering its windows.
The Taliban have carried out numerous attacks in Jalalabad, Kabul and elsewhere in the east. But the choice of a police station as a target reflected an effort to show they can still penetrate heavily secured areas despite numerous US and Afghan offensives against them.