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.


UN, aid groups warn Gaza operations at risk from Israel impediments
US approves $11.1 billion arms package for Taiwan, largest ever
Trump adds seven countries to full travel ban list
Indian parliament votes to allow private firms in nuclear power sector
Doctors in England start five-day walkout during flu surge
Israeli settler kills 16-year-old Palestinian in West Bank, mayor says
Paris' Louvre reopens partially but staff vote to extend strike
Delhi restricts vehicles, office attendance in bid to curb pollution
