The incident took place a day after religious extremist blackened the face of Pakistan's Foreign Minister Khwaja Asif with ink when he was addressing his party's worker's convention in his hometown in Sialkot, some 100-km from Lahore.
Today , Mr Sharif was a chief guest at Jamia Naemia seminary, Ghari Shahu Lahore.
As Mr Sharif was heading towards rostrum for a speech, a student hurled a shoe at him that hit his shoulder and ear.
The student also managed to reach in front of Mr Sharif and chanted "Labbaik Ya Rasoolullah" slogan.
The security personnel caught the student and his other accomplice who also chanted "Labbaik Ya Rasoolullah" slogans and gave them sound thrashing.
Later, the two students were handed over to police. Police identified the shoe thrower as Abdul Ghafoor, a former student of the seminary, and his accomplice as Sajid.
The situation became very tense after the incident.
The religious parties especially Tehreek-e-Labbaik Pakistan had held Sharif and his party (PML-N) responsible for making an attempt to change a clause related to finality of Prophet Mohammad (PBUH) in the Constitution.
In yesterday's incident, Faiz Rasool, who threw ink at the foreign minister, told the police that he vent out his anger because the PML-N had tried to change the finality of the Prophet in the Constitution.
"This hurt the sentiments of millions of Pakistanis including myself," he said.
Pakistan's Law Minister Zahid Hamid had to resign last November when hundreds of Tehreek-e-Labbaik Pakistan supporters camped at Islamabad's Faizabad traffic interchange forcing the PML-N government to take action against those in the federal cabinet responsible for attempting to change this clause from the Constitution.
The mainstream parties -- Pakistan People's Party and Pakistan Tehreek-e-Insaaf -- condemned the incident.
PML-N leader and Railway Minister Khwaja Saad Rafique said those afraid of popularity of PML-N are behind such incidents.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.