The market, a short walk from the army headquarters in Rawalpindi, near the capital, Islamabad, is in one of the most secure areas of the city, said police chief Akhtar Hayat Lalika. The area was cordoned off by the military immediately after the blast.
Lalika said 14 people were wounded.
Two college students wearing blue uniforms were killed, said a Reuters photographer on the scene.
Their bodies lay near wreckage of a bicycle and pools of blood. Rescue workers struggled to help the wounded. Windows were shattered several hundred metres away.
Taliban spokesman Shahidullah Shahid claimed responsibility for the blast on behalf of the Islamist insurgents.
"We will continue attacks on the government and its armed forces as the government has neither announced ceasefire nor peace talks with us," he said.
A bomb planted by the Taliban ripped through a vehicle carrying Pakistani troops on Sunday, killing 20 and prompting Prime Minister Nawaz Sharif to cancel his trip to the World Economic Forum in the Swiss resort of Davos this week.
The government is keen to pursue peace talks with the Taliban to end the insurgency but there has been an upsurge in attacks since Sharif won elections in May 2013.