Pope Francis drew cheers and laughter from a crowd of 150,000 in St Peter's Square when he broke with tradition to deliver an impromptu homily on forgiveness in his first Sunday window appearance at the Vatican.

Delivered in Italian rather than the conventional Latin, the pope's off-the-cuff remarks were warmly received at the mass at St Anna's church.

Instead of a written speech, the pope began with a warm "buon giorno" ("good day") and concluded with "buon pranzo" ("have a good lunch") in the spontaneous style that is fast becoming a hallmark of his papacy.

"Thank you for your welcome and for your prayers," he said. "Pray for me."

Delighting crowds with an unscheduled appearance at a side gate of the Vatican, Pope Francis shook hands with parishioners and kissed babies as he entered the church.

After mass, Francis crossed into the street to greet well-wishers, grasping outstretched hands, while some even gripped him on the shoulder. Crossing at a set of traffic lights, Francis then dashed upstairs to make his window appearance from the papal apartment in the Apostolic Palace.

The window was opened for the first time since his predecessor, Benedict XVI, gave his final window blessing on Sunday 24 February. Pope Benedict retired four days later, the first pontiff to do so in nearly 600 years.

Francis was elected on 13 March, and has been staying in a hotel on Vatican premises until the papal apartment in the palace is ready.

Hundreds of traffic police were deployed, buses rerouted and streets were closed off to channel the crowd as it passed up the main boulevard from the Tiber river to St. Peter's Square on a day when the city also hosted its marathon.

After the mass, the pope stepped out of the church, waving to the crowd and greeting parishioners individually. One young man patted him on the back, another sign of the informality that has been evident from the outset of his papacy.

"Francesco! Francesco!" children in the street called after him.

Patting one boy on the head, Pope Francis asked: "Are you a good boy?"

The child nodded, only for the pope to ask again: "Are you sure?"

In his homily, Francis said the core message of God was "that of mercy", remarking on how people were often harder on others' shortcomings than God Himself.