Pope John Paul II has issued a directive barring all Roman Catholic priests from serving in public office, ranking U.S. Catholic sources confirmed yesterday.

Most immediately affected here is Rep. Robert F. Drinan (D-Mass.), the only Roman Catholic cleric in Congress.

Drinan was planning to seek reelection to his sixth congressional term in November. But Jerome Grossman, chairman of Drinan's reelection committee, told reporters yesterday that the priest-politician "is not going to run."

Drinan could not be reached for comment last night. Dorothy Reichard, his district director in Massachusetts, told The Washington Post that her boss "has been ordered not to seek reelection" and that "I expect he will obey the order."

"It's not an order just directed at Rep. Drinan," Reichard said. "It's directed at priests worldwide, across-the-board."

Msgr. Lawrence M. Purcell, secretary to the Most Rev. Jean Jadot, the papal delegate in Washington, confirmed last night that the directive has been handed down by the pope.

"This, basically, is an implementation of a longstanding ruling of the church," said Purcell, an American.

"The law of the church, canon law, has long said that priests should not hold public office -- at least not without special permission to do so," Purcell said.

He added: "It should be made clear that it [the directive] is not really something new. It is simply upholding what has been the regular practice of the church."

In fact, however, over the years, Catholic priests around the world have become increasingly involved in governmental operations -- either through elective or appointive offices.

Reached last night, ranking sources in the Society of Jesus, or Jesuits, of which Drinan is a member, said the papal directive would end that involvement.

"My interpretation is that it says elected priests must not seek reelection, and that those in other governmental, policy-making positions must resign as soon as it is convenient and practicable," said one well-placed Jesuit, who requested anonymity because his superiors plan to issue a news release on the directive today.

Asked why Pope John Paul II is now enforcing the ruling on priests in public office, the source said: "Who knows? This is what the new pope wants. His predecessors had other ideas."

There was no clear reading yesterday on exactly how many priests are affected by the order, or how it will be received, particularly in the Third World where many priests are involved in public advocacy and often are at odds with what they see as oppressive governments.

"No one knows where this thing is going from here," said the Jesuit who requested anonymity. "I certainly don't."

Besides Drinan, other U.S. priests expected to be affected by the ruling include the Rev. Robert J. Cornell of the Norbertine Order.

Cornell, a former Wisconsin congressman, was defeated for reelection in 1978 but is running for office again this year. Cornell, reached at his home in DePere, Wis., last night, said he would have to see the directive -- or be informed of it by his superiors -- before making any decision about his political life.

"So, far, I haven't heard anything from anyone," he said.

The Associated Press reported yesterday that Drinan had tried to get himself exempted from the papal order, but failed to do so. The news service quoted the Rev. Richard Lynds, director of communications for the Rev. Edward O'Flaherty, head of the Jesuit order in New England, as saying Drinan has "very graciously accepted the ordinance."

"It is the intention of His Holiness [the pope] that no priest should be involved in politics, and Father Drinan has very graciously accepted the ordinance," Lynds was quoted as saying.

"The order came from the pope through Father Pedro Arrupe, provincial general of the Jesuits in Rome, to Father O'Flaherty," AP quoted Lynds as saying.

Drinan, 59, has favored legislation permitting the use of government funds for abortions. But there was no indication last night that his position on that matter provoked the pope's directive.

The disclosure of Drinan's plans not to seek reelection has touched off the beginning of what appears to be a hot contest in his congressional district, among the most liberal in Massachusetts.

Shortly after word leaked out yesterday that Drinan would not run, popular liberal state Rep. Barney Frank of Boston and John Kerry, the assistant district attorney for Middlesex County and a former leader of Vietnam Veterans Against the War, announced they would seek the seat.

Other prominent liberals also are expected to announce today, since the filing deadline for the congressional race is 5 p.m. Tuesday.

Drinan frequently has been the target of charges that he mixes religion and politics too freely. He, in return, has accused the nation's Christian leaders of sitting on the sidelines while the temporal needs of the poor and otherwise disadvantage go wanting.

The priest first went to Congress in 1970, largely on the strength of his opposition to the Vietnam war. Before that, he served 14 years as dean of the Boston College Law School.

Drinan, the first Catholic priest elected to Congress, has built a solid liberal record -- supporting, besides federal abortion aid, women's rights issues, school desegregation and numerous social aid programs.

By staying out of politics, the clergy was losing its voice "on the great moral questions" of the day -- hunger and potential nuclear war, Drinan once said.

"We have chaplains in the legislature -- men with voice but no voice . . . We make the pretense of beginning the day with prayer," Drinan said.