According to the Dawn, Sharif went to Jamia Naeemia mosque marking the death anniversary of a cleric Mufti Mohammad Hussain Naeemi.
This incident has added to the series of such attacks targeting various leaders across Pakistan in the recent days.
However, the ousted prime minister went ahead with his address, although reportedly shortening his speech, only to thank the organisers and saying words of prayer for the deceased cleric.
The accused was caught and later thrashed by the audience before handing him to the security agencies present at the venue.
An investigation has been launched into this incident.
Condemning the incident, opposition leader Sheikh Rashid termed it to be a complete collapse of intelligence and a result of 'overconfidence' shown by Sharif.
He further advised Sharif to speak from behind a bullet-proof glass in future.
Earlier on Saturday, a miscreant smeared ink on the face of Pakistan Foreign Minister Khawaja Asif at a PML(N) convention.
Prior to that on February 24, Interior and Minister for Planning, Development, and Reforms, Ahsan Iqbal was also attacked by a shoe while delivering a public address. (ANI)