The bomb was planted in a hotel restaurant in Jandola, the gateway town to the troubled region of South Waziristan, and destroyed nearby weapons shops and other businesses, military and civilian officials said.
"I can confirm that it was a bomb blast," local administration official Sajid Salim told AFP. "Twelve people were killed and more than 40 people were hurt."
The area was already tense after a series of incidents, including the reported killing of an al-Qaida commander, the abduction and murder of two soldiers and a clash between rebels and criminals in which 15 people died.
"It was a terrorist attack, it was a targeted blast at a restaurant in a hotel," a military official told AFP on condition of anonymity.
However the official did not say whether the blast, which happened at around 9am (0400 GMT) on Thursday, was believed to be linked to the other violence in the troubled border region.
Security forces have a heavy presence in Jandola, routinely checking all vehicles and people moving in and out of the rugged area.
"It was a terrorist attack, it was a targeted blast at a restaurant in a hotel"
Unnamed military official
Pakistan has deployed thousands of troops in the tribal areas to hunt rebels who sneaked across the mountainous border in late 2001 after the US-led invasion of Afghanistan, and their local supporters.
But rebels continue to fire rockets at government and military installations in the area and the military has carried out major operations in South and North Waziristan.
Also on Thursday the bodies of two Pakistani paramilitary soldiers were found, two days after they and two other soldiers disappeared in Wana, the main town in South Waziristan, military officials said.
"They were beheaded," one official said on condition of anonymity.
Fighting broke out near the town
of Miranshah on Tuesday
The four soldiers went missing on Tuesday night after visiting a market in defiance of orders not to leave their camp in Wana for security reasons. Two of them were seen being forced into a vehicle, officials said.
Meanwhile rebels in North Waziristan hanged the bodies of local bandits in the street after clashes in which 21 people died, officials and witnesses said, raising the death toll from 15.
Fighting broke out near the region's main town of Miranshah on Tuesday after the rebels, backed by students from local Islamic religious schools, apparently refused to pay criminals extorting money from passing drivers.
The rebels killed another six on Wednesday, dragging them from their houses, tying the bodies to their vehicles and shoving burning cigarettes, liquor bottles and money in their mouths, intelligence officials said.