Sharif was operated on Tuesday on advice by doctors that he needed surgery to remove heart-related complications.
Foreign Office spokesman Nafees Zakaria said that the prime minister is recovering after undergoing surgical procedure for heart.
He said a large number of world leaders have conveyed their messages and showed special gestures for the prime minister's successful heart surgery and speedy recovery.
"The Government of Pakistan expresses its gratitude to them," he said.
More From This Section
Separately, Nepal Prime Minister K P Sharma Oli also wished early recovery and good health for Sharif.
Mark Lyall Grant, British National Security Adviser, also conveyed his best wishes for Sharif.
Earlier, British Prime Minister David Cameron in his message said "I am sorry to hear that you have been unwell and undergoing treatment in London".
"Please accept my best wishes for a full and speedy recovery to good health from your operation, and I look forward to our next meeting," said Cameron.