Rome (CNN) -- John XXIII and John Paul II were canonized Sunday by Pope Francis in an unprecedented ceremony witnessed by huge crowds gathered in St. Peter's Square in Vatican City.
Millions more around the world watched as two former pontiffs were for the first time installed as saints in a dual canonization.
The faithful and the curious packed the streets of Rome around the Vatican before dawn, hoping to gain entry to St. Peter's Square and catch a direct glimpse of church history in the making.
Vatican Radio put the crowds at some 800,000 in the St. Peter's area, including the square and the roads and gardens around it. Another 500,000 followed the proceedings on giant screens set up around Rome, according to estimates based on police aerial shots.
In another first on a historic day, two living popes were present for the ceremony.
Pope Emeritus Benedict XVI, who resigned from the papacy a year ago citing health reasons, was not at the altar but was greeted warmly by Francis both before and after the event.
Many of those gathered in the square for the solemn open-air ceremony carried flags and banners. The red and white Polish flag was prominent among them, a reflection of the affection felt for John Paul II in his homeland, Poland. Another read simply, "Thank you."
With the canonization, a holy relic for each of the popes was formally presented to the altar before the crowds. Giant banners showing the faces of the two late popes hung on the facade of St. Peter's Basilica.
In his homily, Francis described the pair as "men of courage" who bore witness to God's mercy.
"They were priests, bishops and popes of the 20th century," he said. "They lived through the tragic events of that century, but they were not overwhelmed by them. For them, God was more powerful, faith was more powerful."
He paid tribute to the efforts of John XXIII and John Paul II to renew and strengthen the church.
The landmark Second Vatican Council called by John XXIII was of great service to the church, he said. That council helped to bring the church to the people, for example by allowing languages other than Latin to be used for Mass.
John Paul II, who served for nearly 27 years, is seen as the "pope of the family" and wanted to be remembered that way, Francis added.
After greeting visiting dignitaries, Pope Francis climbed into the Popemobile, a chance for him to get closer to some of the many faithful who have flocked to Rome.
The joyful crowds waved and screamed as he passed through their midst in the open-sided vehicle, with Francis waving and smiling back.
One American pilgrim, Hector Alicea of Maryland, told CNN it was "a once-in-a-lifetime opportunity" for him and his two children to be there for the event.
"It was very exciting," he said. "We didn't get a lot of sleep and it's very, very crowded, but all in all it was an incredibly cheerful environment."
The event has a special significance for him because his faith was revitalized after he heard John Paul II preach a sermon in Baltimore in 1994, he said. "What we are seeing today is the kind of youth who grew up in the John Paul generation."
He was impressed by the diversity of the crowds, he said, as well as the numbers of young and old among them.
Applause greets Benedict
Vatican spokesman the Rev. Federico Lombardi said beforehand that as many as 150 cardinals and 1,000 bishops would attend the canonization ceremony, as well as some 6,000 priests.
Benedict, looking frail in his white robes, was greeted with applause as he took his place among the bishops and cardinals.
Delegations from more than 100 countries around the world were expected to be present, the Vatican said, including at least 24 heads of state. A large Jewish delegation was also to attend, reflecting the efforts of both popes to reach out to the Jewish faith.
Sunday evening also marks the beginning of Holocaust Remembrance Day.
The two popes canonized are:
John XXIII (1881-1963) -- known as Angelo Giuseppe Roncalli before he became pope -- was one of 13 children born into a family of Italian peasants, farmers from a tiny village in the country's north. He was sent away to study for the priesthood at age 11.
John Paul II (1920-2005), born Karol Jozef Wojtyla, was brought up in a grimy industrial town in Poland and raised by his soldier father after his mother died when he was just 8 years old. He spent his formative years living under first Nazis, then Communists.
His beatification is the quickest in modern times, made possible because Benedict -- who succeeded John Paul in 2005 -- waived the normal five-year waiting period after death to get someone's beatification rolling.
Vatican observers see the decision to canonize both popes together as a masterstroke designed to invite unity within the Roman Catholic Church, since it brings together a conservative and a reformer.
The day chosen for the ceremony, the first Sunday after Easter, is significant because in the church calendar it is Divine Mercy Sunday. Mercy was a theme important to both popes -- and to Francis.
After the Mass, the Basilica of St. Peter will be open into the evening to allow pilgrims the opportunity to visit the tombs of the two new saints, Vatican Radio said.
John Paul II's relic, a vial containing his blood, is the same one used for his beatification ceremony in 2011. John XXIII's relic is a piece of skin removed from his body when it was exhumed -- in order to move his body from the crypt under St Peter's Basilica to the main Basilica -- for his 2000 beatification ceremony.
After the Eucharistic service, their names were included for the first time in the chanting of the litany of the saints.
The huge crowds present in Rome reflect the fact that both men were popular in life and known for their efforts to reach out to ordinary people, a path which Francis also seems determined to follow.
The event is the biggest in Vatican City since the election of Pope Francis last year.
The Vatican's official website said civil security forces were prepared and the subway system would run nonstop through the weekend to accommodate the influx of pilgrims for the ceremony.