Eight to 10 militants, some of them wearing burqas, took control of the police station in Kulachi town of Dera Ismail Khan district after firing indiscriminately and lobbing grenades at guards on Saturday afternoon.
Three attackers wearing suicide vests positioned themselves at strategic points in the police station. Security forces surrounded the police station and exchanged heavy fire with the militants, who took several policemen hostage.
A total of 150 additional policemen were sent to the area to control the situation. A group of policemen entered the police station in an armoured car and eliminated two suicide bombers while the third blew himself up, Khyber-Pakhtunkhwa Information Minister Mian Iftikhar Hussain told the media.
"Ten policemen, including the police station chief, were killed and we rescued the other hostages," he said. It was believed that all the attackers had either been killed or injured in the operation, Hussain said.
"The police station is on fire and there is a lot of smoke. There will be greater clarity after situation is brought under control and the operation is completed," he said.
Other officials said four policemen were rescued from the police station in an injured condition and taken to a nearby hospital.
The armoured car was damaged and its driver injured when a militant detonated his suicide vest. Hussain said the same group of militants was
responsible for a string of robberies in the area. Policemen from the Kulachi police station had foiled some of their crimes.
"It looks like the attackers wanted to hole up in the police station for three to four days and present demands to the authorities but the police foiled their plans by making sacrifices and showing bravery," said Hussain, the information minister of Pakistan's restive Khyber-Pakhtunkhwa province.
No group claimed responsibility for the attack but police officials said militants had been active in the area for a long time.
Kulachi is located in an area bordering the restive South Waziristan tribal region.
In a message, Pakistan Prime Minister Yousuf Raza Gilani condemned the attack on the police station and paid tribute to the law enforcement personnel for fighting and eliminating the militants. He reiterated his government's "firm resolve to fight against these elements till their complete elimination from the country".
Furious Pakistan slams deadly US drone strikes
2 journos among 35 dead in Peshawar blasts
Dialogue, not war, the solution to Indo-Pak row: Gilani
India to host Pakistan for Tests in 2013
5 killed in suicide attack in Peshawar