A growing rift between Nacaragua's Sandinista rulers and its powerful Catholic Church was partially patched over yesterday with an agreement that allows priests now serving in the government to maintain their political positions, at least for the present.

Priests serving within the government, including four at Cabinet level, will not be allowed to perform mass, or in any way use their position as clerics to endorse the government, however, under the accord worked out over two days of meetings with the Nicaraguan Episcopal Conference.

The agreement provides a "temporary exception" for these priests from previous orders by the Vatican and local church hierarchy that all of them leave the government immediately.

One lower ranking cleric in the government said he thought the accord was "a bit of chivalry toward the church" on the part of the Sandinista leadership, because the church was becoming deeply divided over the issue.

Some of the more radical priests in the government, including Social Welfare Minister Edgard Parrales, have publicly questioned the right of the church hierarchy to limit their participation in the government. Yesterday's accord calls for obedience to and constant communication with church authorities.

But the Sandinista government also has reason to fear the power of the church in this deeply Catholic country. Many priests lent vital moral authority to the Sandinistas during the insurrection against the Somoza dictatorship, and as discontent with the new government grows in the face of increasing economic and administrative difficulties the Sandinistas can ill afford to see that authority turned against them.

The Sandinistas have reacted strongly even to relatively mild criticism by Archbishop Miguel Obando y Bravo. On a recent trip to Rome he criticized what he considered the Marxist tendencies of the government and provoked a storm of controversy in the government press.

Pope John Paul II began more than a year ago to express this displeasure with priests serving in any government and while some, such as former U.S. congressman Robert Drinan, withdrew under such pressure, the almost 30 clerical officials here have sought to maintain their position, and the government has backed them up.

After Obando y Bravo issued an ultimatum at the end of June, telling the priests to leave the government, the Sandinistas prohibited him from broadcasting mass over state-owned television.

Although the Sandinistas have made much of their respect for the church and the participation if such priests as Foreign Minister Miguel D'Escoto and Culture Minister Ernesto Cardenal in their government, antagonism still exists.