At least 10 officers and one civilian are dead after Taliban-affiliated suicide bombers attacked a police station in Afghanistan's Jalalabad city on Thursday. (Reuters)

Taliban insurgents exchanged gunfire with security forces inside a posh hotel near the presidential palace in the Afghan capital Thursday, killing eight civilians, just hours after militants killed 10 police officers in a brazen attack farther east.

The attacks came on a day when 77 suspected Taliban fighters captured by Western forces were released from prison.

Sediq Seddiqi, a spokesman for the Interior Ministry, said four teenagers armed with pistols and disguised as guests entered the Serena Hotel on Thursday.

Hours later, when hotel guests were having dinner, the gunmen opened fire, Seddiqi said. Hotel guards and Afghan security forces rushed the guests to a safe room, but eight guests as well as the assailants were killed in the overnight exchange of fire. The slain civilians were three women — two of them foreigners — three men and two children, Seddiqi said.

A Taliban spokesman, Zabihullah Mujahid, said in an e-mail that his group was behind the attack. The Taliban had information that nationals of “occupying countries,” as well as Afghan government officials and some “corrupt” law­makers, were at the hotel to celebrate the Afghan new year, he said.

An Afghan police officer walks around inside the nearby state-run Afghan radio and television building badly damaged when a suicide car bomber blew up his vehicle near a police station in Jalalabad, Afghanistan, Thursday, March 20, 2014. (Rahmat Gul/AP)

The assailants managed to get their weapons past tight hotel security, including body searches and X-ray machines. Security at the hotel was beefed up after a Taliban suicide attack in 2008 killed seven people.

Earlier Thursday, Taliban militants raided a police station in the city of Jalalabad, killing 10 officers. Seven of the assailants were either fatally shot during the clash or were killed by explosives they carried.

The predawn attack began when a suicide bomber blew up a vehicle at the entrance of the police station, located close to key government buildings, including the governor’s office. This allowed six other militants to make their way inside the police base, officials said.

In addition to the 10 police officers and seven attackers, another person was killed and 14 were injured, authorities say.

The attacks came as Afghanistan plans to hold its presidential election on April 5. The vote is seen as a key point in the nation’s history, because it could result in the first peaceful transition of power in Afghanistan.

The attacks came on a day that 77 suspected Taliban detainees captured by NATO-led forces were released.

The releases come a month after the release of 65 inmates from a Bagram detention center, which drew stern criticism from United States and NATO, which considered the detainees dangerous.

NATO and the U.S. military had no comment on the latest release.