Cheers and applause rang out across St Peter's Square after the historic double papal canonisation as many in the crowd fixed their gaze on huge tapestries of the two popes on the facade of the basilica behind Francis. (Agencies)
"We declare and define Blessed John XXIII and John Paul II to be saints and we enrol them among the saints, decreeing that they are to be venerated as such by the whole Church," Francis said in his formal proclamation in Latin.
Relics of each man - a container of blood from John Paul II and skin from John XXIII - were placed near the altar.
The fact that the two being canonised are widely seen as representing contrasting faces of the Church has added to the significance of an event that Francis hopes will draw the world's 1.2 billion Catholics closer together after a string of sex abuse and financial scandals.
The crowd stretched back along Via della Conciliazione, the broad, half-kilometre boulevard that starts at the Tiber River.
The Mass was also attended by former Pope Benedict, who last year became the first pontiff in six centuries to step down.
His attendance gave the ceremony a somewhat surreal atmosphere created by the presence of reigning pope, a retired pope and two dead popes buried in the basilica. Francis went over to greet Benedict twice during the service.
A TRAGIC CENTURY
"These were two men of courage ... and they bore witness before the Church and the world to God’s goodness and mercy," Francis said in his address.
"They lived through the tragic events of that (20th) century, but they were not overwhelmed by them. For them, God was more powerful; faith was more powerful," he added.
John XXIII, who reigned from 1958 to 1963 and called the modernising Second Vatican Council, lived through both world wars.
John Paul II, the Pole who reigned for nearly 27 years, witnessed the devastation of his homeland in World War Two and is credited by many with helping end the Cold War and bring down communism.
While both men were widely revered, there has also been criticism that John Paul II, who died just nine years ago, has been canonised too quickly. Groups representing victims of sexual abuse by Catholic priests also say he did not do enough to root out a scandal that emerged towards the end of his pontificate and which has hung over the church ever since.
The controversy did nothing to put off the rivers of Catholic faithful.
"I think that they were two great people, each of them had their own particular character, so they deserve what is happening," said Leonardo Ruino, who came from Argentina.
The Vatican said more than 500,000 people filled the basilica area while another 300,000 watched the event on large television screens throughout Rome.
The overwhelming majority in the crowd were Poles who had travelled from their home country and immigrant communities as far afield as Chicago and Sydney to watch their most famous native son become a saint.
"THE ENDS OF THE EARTH"
Hundreds of red and white Polish flags filled the square and the streets surrounding the Vatican, which were strewn with sleeping bags, backpacks and folding chairs.
"For years Pope John Paul II took the Church to the ends of the earth and today the ends of the earth have come back here," said Father Tom Rosica, head of Canada's Salt and Light Catholic television network.
Families and other pilgrims had waited for more than 12 hours along the main street leading to the Vatican before police opened up the square at 5:30 a.m.
Some people said they had managed to sleep on their feet because the crowd was so thick.
About 850 cardinals and bishops celebrated the Mass with the pope and 700 priests were on hand to distribute communion to the huge crowd.
About 10,000 police and security personnel and special paramedic teams were deployed and large areas of Rome were closed to traffic.
John, an Italian often known as the "Good Pope" because of his friendly, open personality, died before the Second Vatican Council ended its work in 1965 but his initiative set off one of the greatest upheavals in Church teaching in modern times.
The Council ended the use of Latin at Mass, brought in the use of modern music and opened the way for challenges to Vatican authority, which alienated some traditionalists.
John Paul continued many of the reforms but tightened central control, condemned theological renegades and preached a stricter line on social issues such as sexual freedom.
A charismatic, dominant pope, he was criticised by some as a rigid conservative but the adoration he inspired was shown by the huge crowds whose chants of "santo subito!" (make him a saint at once!) at his funeral 2005 were answered with the fastest declaration of sainthood in modern history.
Cheers and applause rang out across St Peter's Square after the historic double papal canonisation as many in the crowd fixed their gaze on huge tapestries of the two popes on the facade of the basilica behind Francis.