The Supreme Court ruled yesterday that federal, state and local governments cannot refuse to hire, promote or transfer most employees because of their political affiliations or party activities, a decision that effectively outlaws patronage.

The court said such practices violate the First Amendment rights of employees unless party affiliation is "an appropriate requirement" for the position.

The 5 to 4 decision extended a 1976 ruling in which the court said government officials could not constitutionally fire or threaten to fire employees because they do not belong to the correct political party. Yesterday's decision applied that rule to the gamut of employment decisions -- hiring, promotion, transfer and recall after layoffs.

"To the victor belong only those spoils that may be constitutionally obtained," said Justice William J. Brennan Jr., writing for the majority. Government officials, he said, cannot coerce employees to "compromise their beliefs" to obtain jobs or win promotions.

In a scathing dissent, Justice Antonin Scalia accused the court of engaging in "constitutional civil-service reform" in wiping out the "venerable and accepted tradition" of patronage and warned that its ruling "may well have disastrous consequences for our political system."

Chief Justice William H. Rehnquist and Justices Sandra Day O'Connor and Anthony M. Kennedy joined Scalia's dissent.

The decision is expected to have the greatest impact on local and state employment practices, with little or no effect on the federal system.

The federal civil service system insulates employment decisions from political affiliations except for a few political employees.

Political scientists said the decision in Rutan v. Republican Party of Illinois is likely to mark the end of the long-standing but waning American tradition of patronage.

"This is a very far-reaching decision," said University of Virginia political scientist Larry Sabato, who has written extensively on the issue. "It's going to reach into the lowest level and mid-levels of government."

Paul Tully, political director of the Democratic National Committee, said he thought the decision would affect political organizations in suburban areas such as Long Island, N.Y., and in some parts of the Deep South and some jobs "tucked away" in some city and state governments.

"But in a communications-era politics," he said, "the currency for an elected official is performance and record -- it isn't patronage jobs. We've all had to learn how to live in this new era, and Democratic governors had to learn it fast."

The ruling came in a challenge to a screening process maintained by Republican Gov. James R. Thompson of Illinois, a state where rewarding friends and political allies remains a tradition honored by both parties.

Under the system, Thompson's personnel office, in reviewing all employment decisions in the state's 60,000-member workforce, examines whether a person voted in Republican primaries, made campaign contributions or worked for the party or its candidates, and enjoys support of party officials.

Those challenging the patronage system include a rehabilitation counselor who said she was repeatedly denied promotions to supervisory positions because she had not worked for the party, a road equipment operator who said he was denied transfer to an office near his home because of opposition from the party county chairmen and another man who said he had been unable to obtain a job as a prison guard because he lacked support of party officials.

Two others -- a garage worker and a dietary manager with the mental health department -- said they were not recalled after being laid off because they lacked Republican credentials.

The federal appeals court in Chicago said patronage practices violate the First Amendment only when they are the "substantial equivalent of a dismissal." It said hiring decisions based on political affiliation therefore were constitutional.

In reversing that decision yesterday, Brennan said the appeals court test "fails to recognize that there are deprivations less harsh than dismissal that nevertheless press state employees and applicants to conform their beliefs and associations to some state-selected orthodoxy."

He rejected the state's argument that it should be allowed to take party affiliation into account in making employment decisions short of firing because such actions do not change the worker's terms of employment and therefore did not "chill" their First Amendment rights.

"This is not credible," Brennan said. "Employees who find themselves in dead-end positions due to their political backgrounds are adversely affected. They will feel a significant obligation to support political positions held by their superiors, and to refrain from acting on the political views they actually hold, in order to progress up the career ladder."

Brennan said patronage hiring violates the First Amendment's guarantee of freedom of speech and association. "A state job is valuable," he noted.

Basing "hiring decisions on political belief and association plainly constitutes an unconstitutional condition, unless the government has a vital interest in doing so," Brennan said. "We find no such government interest here."

Scalia, dissenting, focused on the irony that although "partisanship is not only unneeded but positively undesirable" in judges, the president rarely nominates a federal judge who is not a member of his party.

"Thus, the new principle that the court today announces will be enforced by a corps of judges {the members of the this court included} who overwhelmingly owe their office to its violation," he said. "Something must be wrong here, and I suggest it is the court."

Scalia said the "desirability of patronage is a policy question to be decided by the people's representatives."

He said the court's determination that benefits of patronage do not outweigh its "coercive" effects "reflects a naive vision of politics and an inadequate appreciation of the systemic effects of patronage in promoting political stability and facilitating the social and political integration of previously powerless groups."

Thompson said Illinois did not promote or transfer employees on the basis of politics and would continue to contest the lawsuit.

"Only Republicans can hire Democrats and only Democrats can hire Republicans," he joked. "That's going to confuse a lot of people."

Staff writers E.J. Dionne Jr. and Paul Taylor contributed to this report.