An ailing Pope John Paul II (search) celebrated his 25 years as pontiff on Thursday, asking tens of thousands of pilgrims, his admiring Polish countrymen and the men who help run his church to pray for him, saying his future rested in the hands of God.

The festivities, made bittersweet by the pope's obvious ailments, highlighted John Paul's role as one of the most influential religious figures of the last century as he reached a milestone matched by only three of his predecessors.

At least 50,000 people packed St. Peter's Square (search) for an anniversary Mass that began at 6 p.m. -- about the same time a quarter-century ago that white smoke from a Vatican chimney signaled that a Polish cardinal named Karol Wojtyla had been elected the first non-Italian pope in 455 years.

As the sun set over the square, the crowd broke into applause when a weary-looking John Paul was wheeled to the altar, dressed in golden vestments and a jeweled miter, while a choir sang hymns.

He smiled after the greeting from the dean of the College of Cardinals, Cardinal Joseph Ratzinger (search), who praised the pope for his tireless work and his endurance of "criticism and insults."

"You turned to young and old, rich and poor, powerful and humble, and always showed, according to the example of Jesus Christ, a particular love for the poor and the defenseless," Ratzinger said.

The 83-year-old pope, who suffers from Parkinson's disease, read only portions of his prepared remarks, including a prayer, and appeared pained at times. He spoke in a strong voice during his homily, but began slurring his words later in the two-hour service.

"I renew, in the hands of Mary, beloved Mother, the gift of myself, of the present and the future: everything will be done according to your will. Supreme Pastor, stay among us so that we can proceed with you securely to the house of the Father."

And in a portion read by an aide, John Paul said, "Help the pope and all those who want to serve Christ."

As the Mass ended on a floodlit square, John Paul asked for a closing hymn dedicated to the Virgin Mary, for whom he has always had a special devotion.

Official congratulations poured in from overseas.

"The United States and the world are better because of his dedication to sharing his wisdom, guidance and faith," President Bush said in a statement saluting the pope.

"For the past 25 years, His Holiness has led worldwide efforts to develop a new culture of life that values and protects the lives of innocent children waiting to be born. He has also brought the love of the Almighty to people of all ages, particularly those who suffer or live in poverty, or who are weak and vulnerable."

Despite his physical limitations, the pope has pressed on.

Earlier Thursday, he appeared before cardinals to sign an exhortation on the role of bishops, delivering his speech in a weak and slurred voice and relying on an aide to read parts of it. John Paul was joined at the Mass by 149 cardinals, as well 28 of the 30 recently named cardinals who will be installed next week.

At a meeting of cardinals Wednesday, a top Vatican cardinal, Bernadin Gantin of Benin, effectively quashed speculation John Paul might retire, saying popes serve for life.

John Paul arrived on the world stage when the College of Cardinals gathered to name a successor to Pope John Paul I, who died after only 34 days in the papacy.

On that day, the first plumes of white smoke began pouring out of the Sistine Chapel chimney at 6:18 p.m., the sign that the cardinals had found their next pope. At 6:45 p.m., Cardinal Pericle Felici announced the news from the balcony of St. Peter's Basilica, and at 7:15 p.m. John Paul II made his first appearance to the world, asking for patience from Italians because he didn't speak their language perfectly.

Ratzinger recalled those moments in his opening greeting, saying John Paul had "conquered the hearts of Romans with an unforgettable speech," drawing applause from the crowd.

John Paul recalled them too, mentioning his doubts about accepting such a great responsibility and saying his inner debate continues even now.

The pope has been credited with helping to bring down communism in eastern Europe by sparking what amounted to a peaceful revolution in his Polish homeland; seeking to heal divisions between Christians and Jews; and working tirelessly for peace in the world, most recently in Iraq.

The former leader of Poland's Solidarity movement, Lech Walesa, was in Rome for the anniversary and recalled the effect John Paul's election had on Poles, saying: "The arrival of the Holy Father woke up their spirits, gave them courage."

The United States was represented by a delegation headed by the president's sister-in-law, Columba Bush.

Two hours before the Mass began, St. Peter's Square was packed with pilgrims, including many from Poland. Italians jostling for a good view shouted "Viva il Papa!" or "Long live the pope!" while a group of 50 Mexicans waited for reserved seats close to the stage.

"He provoked an enormous revolution, a change of ideology and mentality," said the Rev. Felipe Arredondo Morales, who traveled with the Mexicans from their hometown of Queretar, near Mexico City -- the capital John Paul visited on his first papal trip in 1979.

Joseph Lis, a Polish-born Canadian from Toronto, said he wanted to be in St. Peter's "because maybe I won't see him again."

John Paul is the most-traveled pope ever, visiting 129 different countries in 102 foreign trips. He made more saints than any of his predecessors over the past 500 years combined -- a total of 476 -- part of his aim to give his flock more role models.

On Sunday, he will beatify Mother Teresa, the nun who devoted most of her life to caring for the sick and destitute.

John Paul has opposed abortion, contraception and euthanasia and barred priests from marrying and women from becoming priests.

Such positions alienated some Roman Catholics and sparked criticism that the Vatican was out of touch with society. In particular, the church's opposition to condoms has been blamed by some for hurting the fight against AIDS.

John Paul also had his disappointments: The church sex scandal in the United States weighed heavily on him, and he has not realized his dream of visiting Russia. The Russian Orthodox Church accuses the Vatican of poaching on traditionally Orthodox lands -- a charge the Vatican denies.

The pope hasn't ruled out a trip to Moscow, and he received anniversary greetings from the Russian Orthodox patriarch.

German Cardinal Joachim Meisner said Thursday the pope has agreed to attend the 2005 World Youth Day in Cologne, "if God gives him the strength."

And he has one more milestone looming: He will become the third-longest-serving pope if he surpasses Pope Leo XIII's reign of 25 years and four months, reached about a century ago. The first pope, St. Peter, served for at least 34 years and is considered the longest-serving pontiff.