The incident took place a day after a 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 Sharif was the chief guest at Jamia Naemia seminary, Ghari Shahu Lahore.
As 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 Sharif and chanted "Labbaik Ya Rasoolullah" slogan.
More From This Section
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.
Sharif made a brief speech in which he did not mention about the man who threw a shoe at him.
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.
"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 Peoples Party and Pakistan Tehreek-e-Insaaf -- condemned the incident.