A car bomb killed 17 people including women and children and wounded dozens more when it exploded near a bus queue at a market in Jamrud on Monday, officials said.
The bomb went off in the town of Jamrud, killing or wounding people waiting for buses to take them across the northwest and to other parts of the country, according to officials.
Pools of blood and charred flesh littered the roadside, along with at least 20 burnt vehicles, said an AFP reporter. Clothes, school books, children's shoes and burqas lay everywhere.
Jamrud is in Khyber district, which is part of Pakistan's semi-autonomous tribal belt on the Afghan border.
A district administration office was around 100 metres from where the bomb was detonated but was not damaged in the attack, according to an AFP reporter.
"Seventeen people were killed in the blast. Fourteen bodies were brought to our hospital while three people succumbed to their wounds on their way to Hayatabad Medical Complex in Peshawar," said Doctor Sameen Jan Shinwari at the Agency Headquarters hospital in Jamrud.
"Four women were among those killed in the blast and they were all Afghans. These women were coming from the border in a hired car, which was completely destroyed. These women's Afghan passports were found in a bag," said Shinwari.
He said a five-year-old Afghan girl accompanying the women and two six-year-old Pakistani boys were also among those killed.
Khyber's top administrative official, Mutahir Zeb, played down the idea that the government office was the intended target, but said authorities were still investigating.
"We are still are ascertaining what procedure exactly was used to blow up the vehicle," he said.
Two intelligence officials, speaking on condition of anonymity, said the explosives had been packed into a Suzuki Alto vehicle.
Driver Taj Muhammad, 40, said he was entering Jamrud when he heard the explosion and saw a ball of fire.
"I rushed to the site and saw people engulfed by flames. There were pieces of human flesh and blood everywhere. I saw a little child who was injured and crying. I took this boy to hospital," he told AFP.
"When I picked up the injured boy he looked like my son and I was really so sad."
Pakistan suffers frequent bomb and suicide attacks blamed on militant groups. Its troops have for years been fighting homegrown armed groups in the tribal belt.
On Saturday a suicide squad of five targeted the airport in Peshawar, the main northwestern city close to Jamrud, killing five civilians and blowing a hole in the perimeter wall.
The assault, claimed by the Pakistani Taliban (TTP), sparked prolonged gunfire and forced authorities to close the airport, a commercial hub and air force base on the edge of the tribal belt.
It was the second militant attack in four months on a military air base in Pakistan.
On Sunday a policeman and five militants were killed following gunbattles between security forces and militants suspected of having been involved in the airport attack, security officials said.
The government says more than 35,000 people have died due to terrorism in the country since the 9/11 attacks on the United States.
According to an AFP tally there have been more than 100 bombings, killing 550 people, so far this year, compared to 203 in 2009 when the death toll was tallied at 1,840.