The bomber struck as former nazim (mayor) Hanif Jadoon was leaving the prayer ground after offering Eid-ul-Azha prayers. Jadoon and his bodyguard were killed instantly, police officials said.
Jadoon's son was among the seven injured persons. The wounded were taken to a nearby hospital. The attack occurred as millions of people were celebrating the Eid-ul-Azha festival.
The government had put in place strict security arrangements across Pakistan to prevent terrorist attacks.
No group claimed responsibility for the suicide bombing though such attacks are usually blamed on the Pakistani Taliban.
Taliban suicide bombers have targeted Eid congregations in the past too.
In December 2007, former federal minister Aftab Ahmed Khan Sherpao had a narrow escape when a suicide bomber blew himself up during Eid prayers in Charsadda, killing over 50 people and injuring over 100.
Media reports said Jadoon was a leader of the secular Awami National Party that rules the northwestern Khyber-Pakhtunkhwa province.
Dozens of ANP workers and leaders have been killed in attacks by the Taliban in the past few years.