Pope John Paul II told a congregation of priests and nuns from every corner of the nation today that the Roman Catholic Church will not relax its ban on marriage for priests or admit women to the priesthood.

In the pope's chief message to the American clergy during his U.S. tour, he also indicated that he would be less liberal than his predecessor Pope Paul VI in granting authorizations to priests who seek release from their vow of celibacy in order to marry.

A priest who marries without such dispensation faces automatic excommunication, a prospect that has posed an agonizing dilemma for hundreds of priests.

"Priesthood is forever," the pope said, and then he repeated the dictum in Latin -- "tu es sacerdos in aeternum" -- as the assembled clergymen responded with thunderous applause.

Some American priests, however, seemed less likely to applaud the impact of the pope's call for unbending adherence to the rigors of priestly discipline.Some church leaders feel that the demand of celibacy and the refusal to permit priests to withdraw from their vows have contributed to the sharp decline in the number of Catholic Americans choosing religious vocations.

There has been a 30 percent drop in the number of American nuns over the past 15 years. The population of the priesthood is about the same size it was 15 years ago, but enrollments in seminaries have dropped more than 50 percent.

But the pope's address today indicated that John Paul does not accept the view that holding priests to the sacrifice implicit in their vows is likely to drive people away from the priesthood. Instead -- in accord with the recurring theme of his speeches on this trip that discipline is the key to genuine happiness -- he said that a total, permanent commitment to the priesthood "has indeed stirred us to the depths of our being."

"After centuries of experience," he said, "the church knows how deeply fitting it is that priests should . . . express the totality of the 'yes' they have spoken to the Lord who calls them by name to his service."

Most American Catholic leaders had fully expected John Paul to reiterate the church's views on priests' marriage and women's ordination. But some had hoped that he would take a softer line on granting authorizations to priests who request permission to leave the clergy.

Father David Tracy, of the University of Chicago Divinity School, said that a refusal to grant such dispensations would be "really disturbing," because it would force an individual to choose between a woman he loves and his church.

Pope Paul VI granted thousands of dispensations, but since John Paul took over the Holy See last year he has stopped granting them so that he can study the issue before acting.

If John Paul's assertions on the virtue of discipline for religious men were characteristically blunt, he seemed somewhat less forthright in his brief remarks on admitting women to the priesthood.

Three years ago, Pope Paul set forth detailed biblical and theological authority in his statement barring women from ordination. He said that priests, as the contemporary "image" of Christ, who was male, must also be male.

Today, in contrast, John Paul II passed over the issue in short order. He said the church's "traditional decision to call men to the priesthood, and not to call women" is "in accord with the prophetic tradition" -- that is, with the teachings of the Old Testament prophets.

But the pope, who said Tuesday at the United Nations that freedom from discrimination on the grounds of sex is a basic right of all people, emphasized that limiting the priesthood to men "is not a statement about human rights, nor an exclusion of women from holiness in the mission of the church."

"Rather," he said, "this decision expresses the conviction of the gift of the priesthood by which God has chosen to shepherd his flock."

The Rev. Vincent O'Keefe, a veteran Jesuit observer at the Vatican, said that John Paul's remarks today seemed somewhat more equivocal than Paul's had been. But he added that "I don't expect to see women priests in the Catholic Church while John Paul is pope."

The pope's address today, attended by some 10,000 Philadelphia-area priests and 300 representatives from priests' Senates in every American diocese, was part of a central goal of his trip here: to energize and inspire the clergy and thus reverse the decline in religious vocations.

The reaction during today's mass indicated that the prelate did indeed inspire his fellow clergymen. Those present clapped, cheered, and whistled their appreciation and sang Polish folk songs wishing the pope a long life. The priests continued shooting pictures with strobe lights through the most sacred portions of the liturgy.

The warmest response came when John Paul assured the priests that he was their colleague as well as their superior. Paraphrasing a famous statement by St. Augustine, the pope said, "For you I am a bishop, with you I am a priest."

And the pope managed, as he had previously with young people in New York, Boston and Ireland, to captivate his audience despite a message that emphasized the need for stern personal discipline.

"It was marvelous," said Msgr. W. Louis Quinn, of St. Matthew's Cathedral in Washington, who attended the service. "He had given us a very tough message about what kind of priests we had to be, he was not giving in an inch, and when he finished the homily, the applause was so enormous he couldn't go on with the mass for seven or eight minutes."

At the start of the service, held in the vast confines of Philadelphia's Civic Center, the pope's microphone sputtered and went dead. For several minutes priests and technicans scurried about wildly to solve the problem, and the situation, according to Quinn, "put everybody on edge."

But as soon as the sound system was fixed, John Paul chortled into his chin and said, "I see, also in the United States, some things are not okay." The audience roared with delight.

"Immediately, he relaxed everyone in the room," Quinn said.

The pope told the priests that their role is to be -- in a phrase the Protestant martyr Dietrich Bonhoeffer used to describe Christ -- "a man for others". In addition, he said the priest must be a friend of Jesus, a "constant companion" who knows "special intimacy with Chirst."