When President Vicente Fox kissed the pope's ring and attended a papal Mass this week, he broke a 140-year taboo and partly revealed the clandestine relationship between Mexican leaders and the church.

The public display came during Pope John Paul II's fifth visit to Mexico, when the pontiff canonized Indian Juan Diego and used the occasion to urge Mexico to "reconcile itself with its origins, its values and traditions."

The pontiff then left the country and arrived in Rome on Friday morning, ending his 11-day pilgrimage to Canada, Guatemala and Mexico.

John Paul's three-day visit to Mexico saw some 2 million Mexicans turn out for Masses, for vigils or simply along the roadsides to see the pontiff. And it brought out into the open the long-shuttered relationship between government and the Roman Catholic Church in Mexico.

Since the mid-1850s, when President Benito Juarez declared total separation of church and state, until 1992, the Roman Catholic Church had no legal status in Mexico and all public manifestations of religion were forbidden. Catholic schools were outlawed, and church buildings were taken over by the government.

Around 88 percent of the population is Catholic, but no president or high official could participate in a religious ceremony.

Still, an understanding developed under the surface of state repression and church submission. The government looked the other way when the church violated the law, while the church never tested the state's tolerance for it too much.

Fox, though divorced, has never hidden his Catholicism. He prayed at the Guadalupe Shrine hours before he took office nearly two years ago.

But his kissing of the pope's ring sparked some criticism. Enrique Jackson, senate leader of the Institutional Revolutionary Party, said it was "uncalled for" and would cause controversy.

Senator Jesus Ortega of the Party of the Democratic Revolution (PRD) said the kiss "went beyond prudence and protocol."

But Mexico state governor Arturo Montiel, who also kissed the ring at the Juan Diego canonization, said the gesture "opens up a new era" where "pretending (to be anti-clerical) in Mexico has ended. This is the new Mexico."

Hundreds of thousands of people ignored Mexico's history of distance from the church and swarmed Mexico City to catch a glimpse of the pope.

On Thursday, amid thick clouds of incense, a seemingly invigorated John Paul beatified two Zapotec Indians martyred in 1700. Essentially informants for the colonial government, they were killed by an angry mob after telling authorities about a Zapotec religious ceremony.

For the third straight day, John Paul appealed for greater respect for Indians, who suffer poverty and discrimination throughout the Americas. He urged his followers to have "brotherly solidarity with the neediest and the marginalized."

"I go, but I do not leave," the pope said as he departed. "Although I go, in my heart I remain... Beautiful Mexico, God bless you."

Alicia Martinez, a 45-year-old cake maker, held onto a lamp post, bounced up and down, screamed with joy and cried while trying to point her camera during the few seconds it took the pope to pass in front of her.

"I felt great emotion, great joy and great faith," she said afterward.