Armed men stormed a police station in the southern Pakistani city of Karachi on Friday, killing two people in a hail of gunfire and a series of loud explosions before they themselves were killed.
Security forces retook the building after several hours and killed three militants, a government spokesman said.
Police commandoes and a bomb disposal squad entered the building and a security sweep was under way.
Two people had been killed and 11 wounded in the militants' attack, a government spokesman said.
A huge explosion was heard inside the station after a series of blasts when it was first attacked.
The Pakistani Taliban, or Tehreek-e-Taliban Pakistan (TTP), took responsibility for the attack in a message sent by their spokesman to journalists.
The station houses offices of the city's most senior police. Deputy Inspector General Irfan Baloch told Reuters there could have been up to 30 policemen at the station at the time of the attack.
The TTP, separate from the Taliban ruling neighbouring Afghanistan, has recently increased attacks on police in the northwest of Pakistan as part of its campaign against the government in Islamabad.
Overseas cricket players are competing in the Pakistan Super League, and Karachi is one of the host cities.
There is a game scheduled for Saturday. The police station is located along the route to the stadium and the players' hotel is a few kilometres away.
Police sealed off traffic on the main thoroughfare through Karachi and heavy contingents of security forces, including paramilitary soldiers, had arrived at the scene.


Explosion kills at least 12 outside court in Islamabad
India's Modi says those behind Delhi car blast 'will not be spared'
Trump vows to 'do everything' to help Syria after landmark talks with Sharaa
US Senate passes bill to end government shutdown, sends to House
Ethiopia to be approved as host for COP32 climate summit in 2027
