On Ash Wednesday, Pope Benedict XVI warns against the dangers of internal division as the Roman Catholic Church begins preparations to pick his replacement.

VATICAN CITY — In the last public Mass of his papacy, Pope Benedict XVI exhorted his followers Wednesday to "return to God" and warned against the dangers of internal division just as the Roman Catholic Church begins preparations to pick a new leader to replace him.

Thousands of the faithful packed St. Peter's Basilica to hear the outgoing pontiff inaugurate the season of Lent, traditionally a time of somber introspection and penitence for Christians.

Benedict's Ash Wednesday homily, delivered in a shaky voice, traced those familiar themes, but took on added significance and poignancy in light of his surprise announcement Monday that he was giving up his post at the end of the month.

Believers, he said, should reflect on the sins of disunity that had, at times, "disfigured" the face of the church and its message to the world.

"Overcoming individualism and rivalry is a humble and precious sign for those who have distanced themselves from the faith or who are indifferent," the pope said.

Arrayed before Benedict were the dozens of cardinals who will elect one of their number to succeed him. Critics have assailed the Vatican as being rife with factionalism and dysfunction, problems that some say may have informed the decision by a wearied Benedict to step down.

During the service, attendees wiped away tears as the 85-year-old pope, looking stooped and wan, rubbed ashes on devotees' heads, distributed communion and issued a blessing in the cavernous splendor of the centuries-old basilica. Vatican officials had moved the service from its usual venue, a much smaller church, to St. Peter's to accommodate the crowds who started lining up for entry hours before the Mass began.

The congregation burst into a standing ovation toward the end of the two-hour service, applause that threatened to go on for several minutes until Benedict broke in and said: "Thank you. Let's get back to the prayer."

It was a characteristically modest interpolation for a reserved and intellectual pope who has never seemed entirely comfortable with public adulation or pressing the flesh. The people who turned out to see him during his international travels were often respectful rather than raucous like the throngs that greeted his charismatic predecessor, Pope John Paul II.

But the acclaim was more fulsome Wednesday amid the knowledge that his papacy is about to draw to a sudden close, from choice and not from death. His weekly general audience, his first appearance in public since he announced his resignation, opened to sustained applause from the thousands who managed to get in.

Benedict reiterated his statement that he no longer had the strength to meet the demands of the papacy; his exit now, he said, was "for the good of the church." He thanked followers for their outpouring of goodwill in "these days that haven't been easy for me" and requested that they "continue to pray for me, the church and the future pope."

In his homily, Benedict revisited passages from the book of Joel that he cited in his first Ash Wednesday service as pope, in 2006.

Vincenzo Opportuno and his family drove 300 miles from Padua to Rome to be present for what they described as an "extraordinary moment in history," a final public Mass by a pope whose departure date from office is now known to the world, not just to God.

"We'd like to be here to pray with him on this special occasion," said Opportuno, 28, who regards Benedict as an exemplary pontiff. "He spoke in a way that everybody could understand — people who are not Catholics or Christians, a way to explain the faith."

Church officials said for the first time Wednesday that Benedict might provide counsel to the new pope from his intended retirement residence in a renovated monastery on Vatican grounds, only a few hundred yards from the papal apartment.

Some commentators have expressed concern about unclear lines of authority and divided loyalties within the Vatican with a former pontiff who not only remains alive but so close at hand. But Vatican spokesman Federico Lombardi waved away such worries.

"The successor and cardinals will be very happy to have nearby a person who more than anyone understands the spiritual needs of the church and his successor," Lombardi said. "He will be discreet and sustain his successor with spiritual service."

Until his final day on the job, Benedict is expected to maintain a regular schedule of events and meetings, including one with Italian Prime Minister Mario Monti.

His last public appearance as pope will be his Feb. 27 general audience, which will be held in St. Peter's Square. The following morning, he will bid farewell to his cardinals; later, he will have his own personal ascension day when a helicopter lifts him above the Vatican and delivers him to the papal summer retreat of Castel Gandolfo, south of Rome, where he will spend some time before moving into his new residence.