Gunmen with automatic rifles launched an attack at around 7 am (0200 GMT) on a police vehicle patrolling the village of Shahab Khel, 100 km (60 miles) from the Afghan border.
"All the six policemen were killed" under fire from both sides, Tariqullah Khan, a district official in Khyber Pakhtunkhwa province, told AFP.
The death toll was confirmed by a second police official. The Pakistan Taliban -- known as Tehreek-e-Taliban Pakistan (TTP) -- said the police were "coming for a raid" when they were gunned down.
It said in a statement to AFP its own fighters "managed to reach their base safely" after looting weapons and ammunition.
Prime Minister Shehbaz Sharif offered his condolences and said on Twitter, "terrorism continues to be one of Pakistan's foremost problems".
The TTP were at the height of their power in Pakistan between 2007 and 2009, when they held sway over the Swat valley just 135 km (85 miles) north of Islamabad.
They were pushed into Afghanistan by an army offensive after perpetrating a barbaric schoolhouse bombing that killed nearly 150 students in 2014.
US-led forces hunted Taliban of all stripes in Afghanistan during their two-decade occupation following the 9/11 attacks on the United States.
Analysts say the TTP have found a vital foothold and shelter there since the chaotic US departure and the Afghan Taliban takeover in August 2021.