Vatican City (AFP) - Pope Francis led the funeral of his predecessor Benedict XVI on Thursday in front of tens of thousands of mourners in St Peter's Square, an event unprecedented in modern times.
Scarlet-clad cardinals, dignitaries and thousands of priests and nuns from around the world gathered to say goodbye to the German theologian, who stunned the Catholic church in 2013 by becoming the first pontiff in six centuries to resign.
For the first time in modern history, the papal funeral was led by a sitting pope, Francis, who delivered the homily to an estimated crowd of 50,000 people.
"Benedict...may your joy be complete as you hear his (God's) voice, now and forever!" the pontiff said, five days after his predecessor died aged 95.
At the end of the service, Francis blessed Benedict's simple cypress wood coffin, before pallbearers carried it into St Peter's Basilica.
In the papal tombs below, the coffin -- also containing coins and medals minted during Benedict's papacy -- was tied with a red ribbon and placed in a zinc coffin, before being put inside an oak casket.
Benedict was then interred in the tomb where John Paul II's body lay before it was moved for his beatification in 2011.
The Polish pontiff was made a saint in 2014 -- something that some Catholics are hoping will happen to Benedict, with a group holding up a banner Thursday saying "Santo Subito", or "Saint Now".
Born Joseph Ratzinger, Benedict was a brilliant theologian but a divisive figure who alienated many Catholics with his staunch defence of conservative doctrine on issues such as abortion.
Several world leaders and European royals attended the funeral, including German Chancellor Olaf Scholz and Italian Prime Minister Giorgia Meloni.
Hong Kong Cardinal Joseph Zen, 90, was also there after being granted permission by a court to travel following his arrest last year under the city's national security law.
Many members of the public queued up from dawn in thick fog to bid farewell.
"Benedict is a bit like my father, so I had to pay homage to him," said Cristina Grisanti, a 59-year-old from Milan, who hailed the former pope's "purity, his candour, his mildness".
An estimated 195,000 people had already paid their respects during three days of lying-in-state at the basilica.
Many Germans were in the crowd on Thursday as church bells rang out across Benedict's native Germany at the funeral's culmination.
"We owe him so much.We want to show that we stand behind him," said Benedikt Rothweiler, 34, who came from Aachen with his family.
"He always accepted everything the way God wants it.This is a good example for us humans."
Benedict's eight years as head of the worldwide Catholic Church was marked by crises, from in-fighting within the Vatican to the global scandal of clerical sex abuse and its cover-up.
When he quit, Benedict said he no longer had the "strength of mind and body" necessary for the task, retiring to a quiet life in a monastery in the Vatican gardens.
His death brought an end to an unprecedented situation of having two "men in white" -- Benedict and Francis -- living in the tiny city state.
The pair were said to get on well, but Benedict's later interventions on some sensitive subjects meant he stayed a standard-bearer for conservative Catholics who did not like his successor's more liberal stance.
The last time a pope presided over the funeral of his predecessor was in 1802, when Pius VII led the ceremony for Pius VI.
Pius VI died in 1799 in exile, a prisoner of France, and was buried in Valence. His successor had his remains exhumed and brought back for a papal funeral at St Peter's.
Beyond St Peter's, many of the world's 1.3 billion Catholics followed the funeral proceedings.
In the majority Catholic Philippines, churches held requiem masses for the former pontiff, including at Malolos Cathedral near the capital Manila.
"This is an unexplainable feeling to witness this," said Cherry Castro, 67.
Portugal declared a national day of mourning on Thursday, while in Italy, flags were flown at half-mast on public buildings.
The only official delegations to the funeral were from Germany and Italy but other dignitaries attended in a personal capacity.
They included the Belgian and Spanish royals, the presidents of Lithuania, Poland, Portugal, Hungary, Slovenia and Togo, and the premiers of the Czech Republic, Gabon and Slovakia.