The blast happened in the city of Parachinar, a mainly Shia Muslim area on the Afghan border.
The market was full of shoppers when the device exploded. Officials said the death toll was expected to rise.
A faction of the Pakistani Taliban (TTP) said it was behind the blast, adding its goal was "to avenge the killing of our associates".
The group's spokesman said it wanted to "teach a lesson to Shiites for their support for Bashar al-Assad," referring to the Syrian president.
The spokesman warned that his Sunni Muslim group will continue attacking Shia Muslims if they back President Assad, whose regime is entrenched in a six-year civil war that has claimed more than 310,000 lives.
Varied reports have emerged about the cause of the explosion, with some blaming an improvised explosive device (IED) hidden in a vegetable box.
Other accounts suggested a suicide bomber was responsible.
Sabir Hussain, a doctor at Parachinar's main hospital, told the Associated Press agency that 11 critically-wounded people were brought there, but died during treatment.
He said several others in a serious condition were being moved to other hospitals for better care.