Sandinista supporters heckled Pope John Paul II at mass today as he called on the hundreds of thousands in the vast central plaza to reject the "popular church" that is allied with the revolutionary government and to accept the absolute authority of his bishop.

Weary-looking but apparently in a combative mood at the end of his one-day visit here, the pontiff lifted a crucifix above his head and waved it at the crowd before him, then turned and showed it symbolically to the massive painting of Sandinista heroes that loomed behind him.

As he warmed to his homily, however, with unremitting demands for obedience from radical priests who have served in this government against his wishes, the Sandinista partisans who had packed the front of the crowd of about 350,000 began chanting, "One church on the side of the poor!" and "We want peace!" The pope was forced to stop his homily and to order, "Silence!"

How deep the ranks of the chanting young Sandinistas went into the overall throng was impossible to tell. The police assigned to control the crowd frequently led the chants.

Members of the papal entourage said they had never seen anything like it on other tours.

With carefully controlled anger, the pope departed from his prepared text to tell the increasingly noisy Sandinistas waving their party flag alongside the national and papal banners, "The church is the first that wants peace." But as John Paul concluded his sermon, the entire Sandinista National Directorate was on its feet, with Interior Minister Tomas Borge and Defense Minister Humberto Ortega clapping and shouting in time with the crowd, "Power to the people."

The Sandinistas received the pope this morning with a mixture of formality and perhaps an intent of provocation. Contrary to most expectations that the priests in the government would maintain a low profile, Culture Minister Ernesto Cardenal decided to stand with the rest of the Cabinet when it greeted John Paul. The pope at first appeared intent on passing the Cabinet without formal introduction but he was led to each member, including Cardenal, who wore his usual beret and blue jeans.

Cardenal genuflected and reached for the pope's hand in an apparent attempt to kiss the pope's ring or receive a papal blessing. Instead, he received what appeared to be a scolding as the pope shook his hand at the priest and the Nicaraguan nodded in compliance.

The Associated Press quoted a Vatican official as saying that the pope told Cardenal to "straighten out your position with the church."

Nicaragua's leaders, like other revolutionaries in Latin America, have built much of their popular support through an alliance between Marxist and Catholic advocates of "liberation theology." Here, it is part of the government's basic philosophy, and the pope's visit appeared aimed at breaking down those ties that have come to threaten the established order of the church.

With his homily on church unity here tonight and an address at the University of Leon this morning in which he insisted that the church and its schools remain separate from "alien ideologies," the pope was reinforcing the stands taken by Managua Archbishop Miguel Obando y Bravo.

The archbishop and the Bishops' Conference over which he presides originally supported the Sandinista government but split with it in 1980 over questions of growing censorship and state control that restricted individual freedom and church prerogatives.

For more than two years there has been a running battle of words and sometimes physical intimidation between the government and Obando y Bravo's sector of the church. Meanwhile, members of what they like to call the "committed" or "popular" church have continued actively to support the Sandinistas.

In his mass today on a platform that the government insisted have no built-up cross, Pope John Paul told the Nicaraguans that "unity of the church is called into question when the powerful elements of which it is made and maintained," especially "obedience to the bishops and the pope," are subordinated to "earthly considerations, unacceptable ideological commitments, temporary options, including conceptions of the church that supplant the true ones."

"When a Christian, whatever his condition, prefers whatever other doctrine or ideology to the teaching of the apostles and the church, when one makes these doctrines the criterion of our vocation . . . and when one installs 'parallel teachings,' then the unity of the church is weakened," he said.

As he looked out over the waving placards and banners of the crowd in the huge plaza built by the Sandinistas to celebrate their July 19, 1979, victory, a billboard greeted the pope with the message that "between Christianity and revolution there is no contradiction."

Edgard Parrales, a priest who hid Sandinista rebels and their arms during the insurrection and now serves as their ambassador to the Organization of American States, said the church hierarchy had come to believe that "unity is the same as conformity, that unity is a submission of the mind," and priests such as himself are unwilling to accept that.

The pope, in an obvious reference to Parrales and four other priests who serve in the Sandinista government, including Foreign Minister Miguel D'Escoto, said, "No Christians, and even less a person whose title is especially concentrated by the church, can make himself responsible for breaking that unity, acting on the margin or against the will of the bishop." D'Escoto is in India for the conference of nonaligned nations about to begin there.

Earlier in the day, the Sandinista leadership greeted the pope with sharp criticism of the United States that attempted to win some more specific support for their grievances than his broad calls for dialogue to resolve the region's conflicts.

Junta member Daniel Ortega insisted that Washington is attacking basic human and social values shared by both the pope and the "revolutionary process." But the pope, far from condemning the United States, combined his conventional call for peace with a warning against "sterile accusations" from all sides and expressed the desire that they would be replaced by sincere efforts to reach understanding.

In a careful bit of diplomacy worked out between the Vatican and the Sandinista government, the pontiff was greeted this morning first by the junta, then by the uniformed members of the Sandinista National Directorate before reaching Obando y Bravo and the country's eight other bishops.

As an appendage to his homily tonight, the pope offered a message of consolation in the Miskito language to Indians on Nicaragua's Atlantic coast who have been forcibly relocated by the Sandinistas. Many of them have taken up arms against the government here.

The pope left Nicaragua tonight and flew back to Costa Rica. He will visit Panama Saturday.