Five soldiers and five civilians were also wounded after the militants attacked the Dabori post manned by paramilitary troops in Orakzai, the officials said.
"At least 20 militants have been killed in the pre-dawn clash," a military official told AFP by telephone. Their bodies were spotted during a search carried out by helicopter gunships, he said, requesting anonymity.
There was no independent confirmation of the death toll because neither journalists nor aid workers are allowed free movement within the semi-autonomous tribal belt bordering Afghanistan.
Local administration official Ehsanullah Khan told AFP that around 100 Taliban loyalists attacked the checkpoint.
"They stormed the check post and killed one soldier and wounded five others," he said. A shell landed on a nearby house, injuring five civilians, Khan added.
Sporadic exchanges of gunfire continued late into the morning, he added.
Copyright AFP (Agence France-Presse), 2011