About 150 people, mostly school children, were killed when Taliban gunmen in army uniforms stormed the Army Public School (APS) here in 2014.
Sharif said in his message that Pakistan took a clear and categorical decision for an indiscriminate action against terrorists after the APS incident.
"We decided to act with our full might for elimination of terrorism and extremism from our society; showing no mercy for those who martyred our little angels. The world has seen that we have dismantled the terrorists' networks and broken their back by rendering matchless sacrifices in this war of our survival," he said.
Sharif extended his heartfelt sympathies to the families of the martyred students and all those who became victims of the tragic incident.
More From This Section
"I share the pain and grief with the bereaved families. The entire Pakistani nation feels and shares the pain of the tragedy and stand by the mourning families," said the Prime Minister.
He said December 16 reminds of the most painful tragedy of "our lives when our innocent students were mercilessly killed at the place of their studies".
A solemn memorial service was held here to mark the tragedy which was attended by families of the victims, politicians, military leadership and others.
Moving scenes were also witnessed as several parents were seen crying on the occasion.
Chief of Army Staff Gen Qamar Jawed Bajwa laid a wreath and offered prayers as he attended the memorial service.
"We can never forget these children, I have photos of them in my office and keep looking at them periodically to remind me of our losses," he said later in a brief address.
APS Principal Tahira Kazi recalled it was a difficult day for the country as everyone felt as though "we would never be able to come out of this pain. But we came out of that time better and stood strong in front of the enemy".