The bomber, who was riding a cycle, detonated his explosives after being intercepted by soldiers in Royal Artillery Bazar, which is very close to the army's General Headquarters and other important military buildings.
Twenty-four others were wounded in the attack. Witnesses said two students wearing uniforms were among the dead.
The market, a short walk from the army headquarters, is located in one of the most secure areas of Rawalpindi, said city police chief Akhtar Hayat Lalika.
Yesterday, a blast within the cantonment of Bannu city in Khyber-Pakhtunkhwa province killed 20 troops and injured 30, prompting Sharif to cancel his visit to Davos, Switzerland, for the World Economic Forum.
Also Read
The banned Tehrik-e-Taliban Pakistan claimed responsibility for the attack, with spokesman Shahidullah Shahid saying it was carried out in response to military operations in the tribal areas and the killing of the group's deputy chief, Waliur Rehman, in a US drone strike last year.
According to police, the suicide bomber was aged between 18 and 20 years and his vest was packed with an estimated 10 kg of explosives.
The powerful blast shattered windows of buildings in the area. Security was put on high alert as the area has key installations like the army-run National Logistics Cell and Armed Forces Institute of Cardiology, where former military ruler Pervez Musharraf was admitted with heart problems earlier this month.
President Mamnoon Hussain and Muttahida Qaumi Movement chief Altaf Hussain condemned the blast.
Yesterday's attack in Bannu too was claimed by the Taliban, which said its onslaught on security forces would continue.