Police in Karachi said they have retaken their headquarters after it was attacked by the Pakistani Taliban. Security forces regained control after several hours and killed all three militants, a government spokesman said. Three police officers and a civilian were killed in the attack, he added. Witnesses reported hearing a huge explosion from inside the station — which houses some of the city's most senior officers — following smaller blasts and gunfire. Some reports say the attackers were wearing police uniforms. Deputy Inspector General Irfan Baloch told Reuters that up to 30 officers could have been inside at the time of the attack. Tehrik-i-Taliban Pakistan (TTP) are most active in mountainous areas near the border with Afghanistan, but they have been carrying out operations in other parts of the country. They have recently stepped up attacks on police in the north-west of Pakistan, as part of their campaign against the Islamabad government. They are separated from the Taliban ruling Afghanistan, although the two share a common ideology. Gunfire and explosions were heard on Friday outside the premises, which is home to several police buildings and officer residences. Three members of the security forces and a civilian were killed and several other security force members were wounded, said government officials and Ghulam Nabi Memon, police chief for Sindh province, where Karachi is the capital. Tehreek-e-Taliban Pakistan (TTP), also known as the Pakistani Taliban, claimed responsibility for the attack. Murtaza Wahab, a government adviser, confirmed that police and paramilitary forces in a joint operation had cleared the police building within three hours of the attack late Friday. President Arif Alvi condemned the assault in Pakistan's chief commercial city and Prime Minister Shehbaz Sharif paid tributes to security forces for the successful operation. When the attack began, a huge explosion was heard inside the station after a series of smaller blasts. Commandos from the elite police unit, troops from paramilitary rangers and army snipers took part in the operation to hunt down the attackers that lasted for more than three hours Pakistan has witnessed a surge in attacks by armed groups since November when the Pakistani Taliban unilaterally ended a months-long ceasefire with the government. The assault on Karachi's police headquarters was carried out weeks after a suicide bomber disguised as a policeman killed 101 people at a mosque in the northwestern city of Peshawar. Authorities blamed the TTP for orchestrating the bombing. — BBC and agencies