Pope Francis has resumed his Sunday custom of greeting the public in St Peter’s Square, two days after being discharged from hospital.

Before launching into prepared remarks, Francis expressed gratitude for “affection, attention and friendship” and the assurance of “the support of prayer” during his hospitalisation for abdominal surgery at a Rome hospital on June 7 to repair a hernia and remove increasingly painful scarring around his intestines.

“This human and spiritual closeness for me was a great help and comfort,” Francis told some 15,000 people in the square.

“Thanks to all, thanks to you, thanks from the heart.”

Pope Francis
Pope Francis thanked the crowd during his appearance (Andrew Medichini/AP)

The 86-year-old pontiff sounded a bit breathless and hoarse at times, but he gestured frequently with his hands for emphasis, deviated at times from the prepared speech, and looked happy to be back to his routine.

While the thousands of Romans, tourists and pilgrims who regularly turn out for the weekly noon appearance of the pope at a window of the Apostolic Palace usually applaud when they catch sight of him, this time the public’s applause seemed louder than usual, with the crowd shouting “long live the pope”

The three-hour surgery under a general anesthetic had forced Francis to skip the Sunday appearance on June 11.

The pope took the opportunity during his address to note that Tuesday marked World Refugee Day, an occasion promoted by the United Nations.

“With great sadness and so much sorrow I think of the victims of the very grave shipwreck that happened in recent days off the coast of Greece,” Francis said.

A woman films with her mobile phone in St Peter's Square
The crowd gathered in St Peter’s Square shouted ‘long live the pope’ (Andrew Medichini/AP)

He was referring to the smugglers’ overcrowded fishing boat, filled with hundreds of migrants, that sank in the Mediterranean Sea last week.

“I renew my prayer for all those who lost their life, and I implore that, always, everything possible is done to prevent similar tragedies,” the pontiff said.

Some of the 104 survivors said that as many as 750 people had been onboard, leaving the possibility that hundreds had perished.

Greek rescuers had recovered 78 bodies.

Questions persist about whether the Greek coastguard could have intervened in time to prevent the vessel capsizing.