The bomb and gun attack occurred in the district of Dera Ismail Khan on the edge of the lawless tribal regions bordering Afghanistan, the army said in a statement.
The police station was being used by the Pakistani Army as a base camp.
Two security officials had earlier put the toll at 24.
Interior Minister Sarfraz Bugti condemned the attack and expressed grief over the deaths, a statement from his office said.
Several people were wounded and in critical condition, said Aizaz Mehmood, an official of the state-run rescue service.
"We are still hearing gunshots," he added.
In a statement, a Pakistani Taliban group, the Tahreek-e-Jihad Pakistan (TJP), which has emerged recently, said its militants carried out the attack aimed at the Pakistani army.
It was not immediately clear whether the group was linked to the main Tahreek-e-Taliban Pakistan (TTP) group of Islamist and sectarian militants, which has targeted the state and its agencies for years, seeking to overthrow the government and replace it with rule based on their harsh brand of Islamic law.