America's leading Roman Catholic prelate, New York's Cardinal John Joseph O'Connor, died last night of complications from brain cancer at the age of 80, surrounded by friends and family who had spent the night at his Manhattan home praying for him.

During his 16 years in the New York Archdiocese, O'Connor established himself as the nation's most prominent Catholic leader and the most provocative. In a city known for its tolerance, he was an enthusiastic defender of the church's opposition to abortion, contraception, women's ordination, the death penalty and homosexuality.

But he distinguished himself by his temperament. He took over the country's most prestigious Catholic appointment as an obscure bishop from Scranton, Pa., but soon proved himself to be a showman and charmer able to hold his own with prominent New Yorkers, such as his friend and co-author, former mayor Edward I. Koch. If he had not become a priest, he would have been mayor of his native Philadelphia, people joked.

"For more than 50 years, he has reached out with uncommon fortitude to minister to the needs of America's Catholics," President Clinton said in a statement. "The courage and firm faith he showed in his final illness inspired us all."

Cardinal James A. Hickey, archbishop of Washington, said O'Connor was "a sterling example of what a bishop ought to be. He was unstinting in his love of the Holy Father, his loyalty to the church, his readiness to serve people in every condition of life."

"He was a great man," said longtime spokesman Joe Zwilling, pausing to catch his breath. "I will miss him a great deal. Obviously, on a personal level, it's difficult to think he'll no longer be with us, that I'll no longer speak to him or learn from him or be guided by him."

In New York, the feeling was universal. As news of his approaching death spread last night, mourners began gathering at St. Patrick's Cathedral on Fifth Avenue to share their grief over a great leader lost.

"The atmosphere is subdued," reported Monsignor Lorenzo Albacete, a priest in the archdiocese. "He was a big star, a big name, a big presence; so much a part of our lives and so much larger than life. Now all we have left are crumbs. So people need for a moment to pause."

O'Connor was uneasy with his celebrity. In columns he wrote himself, O'Connor summoned his working-class roots and his humility. He advocated for labor rights, from increasing the minimum wage to improving conditions for migrant workers. As much as he loved news conferences, he once kicked out a television crew that had crossed a picket line.

He befriended all the important Catholic politicians but was always ready to tell them off. In a 1990 speech addressing their voting habits, he said those "who help to multiply abortions . . . are at risk of excommunication." Among the insulted were then-Gov. Mario M. Cuomo, then-Rep. Geraldine A. Ferraro (D-N.Y.), Sen. Edward M. Kennedy (D-Mass.) and Rep. Charles B. Rangel (D-N.Y.), who was disinvited from a planned speech.

O'Connor led the fight against gay rights legislation and ordered a gay group out of a local parish, prompting gay activists to throw condoms during Mass. At the same time, he disarmed his many liberal critics when he changed bedpans and bathed patients at an AIDS hospice. His intimates said he was most at peace working with the mentally disabled and dying.

He once characterized the Holocaust as "Judaism's gift to the world." He meant that Jews had endured the unendurable, but many were insulted. At the same time, he endeared himself to the city's Jewish leaders, taking up their causes as his own, from Soviet Jewry to antisemitism to the Holocaust to Vatican relations with Israel.

"It's a terrible loss, both for me personally and for the Jewish community," said Rabbi Jim Rudin of the American Jewish Committee. "His remarkable work in building solidarity is indelible. He's a prince. I mean, I'm crying here. . . ."

When he was not making headlines, O'Connor was tending to the clerical business of his adopted city, the hundreds of schools and suburban hospitals and homeless shelters and crisis centers that make up the sprawling and densely populated Archdiocese of New York--the nation's second-largest.

He was most appreciated for raising money to keep inner-city parochial schools open, often by reminding Wall Streeters of their obligations to the poor.

In recent months, he rarely appeared in public as his health declined after surgery last August to remove a brain tumor. When he did attend Mass, he moved as slowly as the ailing man he served, Pope John Paul II.

Even through better times, the two men's paths have tracked closely. They were born four months apart to working-class parents and were ordained as priests within a year of each other. O'Connor thrived thanks to his affinity with the pope. "I want a man just like me in New York," papers reported the pope as saying in 1984, when O'Connor was appointed head of the archdiocese.

While serving in New York, O'Connor would fly to Rome almost monthly and consult with the pope about U.S. Catholics. He was one of only eight Americans among the cardinals (who alone can choose the pope) and was tapped to be the only American on the Congregation that recommends new bishops to the pope.

John O'Connor was born to Irish immigrants on Jan. 15, 1920, in what he called "a little row house" in Philadelphia. His teenage jobs included hawking vegetables on the street and repairing bicycles. At 16, he entered St. Charles Borromeo Seminary, where he shut himself in with the readings of St. Thomas Aquinas.

After he was ordained a priest in 1945, he followed the usual sacerdotal path, teaching high school and doing parish work. But soon he veered off it. While other aspiring bishops studied theology or canon law, he opted for a master's degree in clinical psychology and a Ph.D in political science. Among his professors at Georgetown University in the early 1970s was Jeane J. Kirkpatrick, the former ambassador to the United Nations, who recalled him as "surely one of the two or three smartest graduate students I've ever had."

As his parish, O'Connor chose the Navy, where he settled for 27 years. There he learned management and finances and working within the system, but mostly he learned to live with people. "The same seas that made me seasick also affected my sailors," he told writer Michael Winters, adding, "I learned what it meant to be shot at and watch men bleed to death."

The experience made him unusual among priests, many of whom are pacifists. And in later years, he argued against a nuclear freeze.

As a straightforward church conservative, he was easily caricatured by liberals. His sermons predictably enraged them. He never shouted and often told jokes, but the message was the same--the less popular parts of church orthodoxy simply explained, through straight Catholic theology.

"The truth is not in condoms or clean needles," he once said. "These are lies; lies perpetuated often for political reasons on the part of public officials. . . . Sometimes I believe that the greatest damage done to persons with AIDS is done by the dishonesty of those health care professionals who refuse to confront the moral dimensions of sexual aberrations or drug abuse. Good morality is good medicine."

Yet even his critics admired his insistence on adopting the role of teacher, while most others shied away. Unlike his predecessors, or most other bishops, O'Connor insisted on preaching every Sunday Mass himself, even if it meant flying back from Rome in time for 10:15 a.m. Mass and flying to Rome again for evening meetings.

And no one could deny his humility was genuine. Sometimes he almost apologized for his privileged life, lamenting that he never took the subway or used an ATM. When he became archbishop of New York and a tailor came to measure him for his new vestments, O'Connor declined. "Too much money," he said, and he had his predecessor's vestments altered to fit his six-foot frame.

"Whenever the Church gets too wealthy, and its ministers live too 'high on the hog,' we deservedly lose our credibility," he wrote to Winters. "That's something I'm quite conscious of, since my responsibilities require me to live in a much fancier house than I'm comfortable with."

In recent years, and with his health failing somewhat, friends noticed the cardinal slowing down, and perhaps even preparing for the end. He cut back public appearances, missed a few Masses, made peace with his adversaries.

"The cardinal has been generous to me personally," Cuomo said in recent years, by providing spiritual comfort when the former governor's mother and mother-in-law died shortly after he left office. Ferraro turned nostalgic: "When my son got in trouble in 1986 [on a drug arrest], you want to know one of the first calls I got? It was from Cardinal O'Connor, saying, 'What can I do for you besides pray?' He recognized the turmoil we were going through," she recalled.

In a strange coincidence, rumors began to spread yesterday morning that O'Connor's successor had been chosen, before it was known his illness had taken a grave turn. The unconfirmed choice is Bishop Edward Egan, who heads the diocese of Bridgeport, Conn., and who worked as an auxiliary bishop to O'Connor in New York after spending many years in Rome.

Now that O'Connor has died, the announcement of a successor will likely be delayed until after the funeral, scheduled for 2 p.m. Monday at St. Patrick's Cathedral, with Masses throughout the week. He will be buried in the crypt under the main altar, with all his predecessors, and his red cardinal's hat will hang from the ceiling with the rest.

He is survived by a brother, Thomas J. O'Connor of Sea Isle City, N.J., and two sisters, Dorothy Hamilton of St. Petersburg, Fla., and Mary Theresa Ward of Chadds Ford, Pa.