The Supreme Court ruled yesterday that police officers, like all other witnesses, may not be sued for damages for lying on the witness stand in criminal trials.

The 6-to-3 ruling settled differences among lower courts about whether police should enjoy the same immunity. The justices said police have an even greater need for immunity because of the frequency with which they testify and the resentment their testimony inevitably generates.

Justice John Paul Stevens, writing for the court, noted that police may still be prosecuted for perjury or for criminal civil rights violations if they lie under oath.

In a unanimous judgment, the justices made it more difficult for the federal government to avoid financial responsibility for faulty work by government inspectors of everything from mine and airline safety to housing.

The court refused to bar a Tennessee woman from suing the Farmers Home Administration for the alleged failure of one of its inspectors to warn her of the rundown condition of a house she purchased. Government lawyers called the ruling "limited," saying it jeopardizes one, but not all, of the arguments generally used by officials to combat these potentially costly suits.

The police case stemmed from two separate civil rights damages suits brought by criminal defendants claiming perjury by police officers during their trials.

Carlisle W. Briscoe sued a Bloomington, Ind., officer for $100,000 for allegedly giving false testimony concerning fingerprints in his burglary trial. Briscoe's conviction was overturned by an appeals court. Chris P. Vickers Sr., and James N. Ballard filed a similar suit against a Cedar Lake, Ind., policeman who they claimed committed perjury in their joint sexual assault trial. Vickers and Ballard, who sought $200,000 each, are serving prison terms for the crime.

All three said the officers' actions violated their constitutional right to a fair trial and sued under the Civil Rights Act of 1871, which was specifically designed for constitutional violations by government officials. But the 7th U.S. Circuit Court of Appeals said police, even though they are government officials, are immune from suit for testimony in judicial proceedings, and the Supreme Court agreed yesterday.

In his ruling, Stevens noted that all of those integrally involved in the judicial process--judges, prosecutors and jurors--have been traditionally immune from lawsuits as a way of providing maximum freedom to do their jobs without fear of retribution.

Immunity for witnesses, he said, is designed specifically to encourage them to testify candidly, without the fear that something they say may be used as the basis for a damage suit.

Nothing in the civil rights act, he said, suggests that police officers should be treated differently. "A police officer on the witness stand performs the same functions as any other witness," Stevens wrote.

"Police officers testify in scores of cases every year, and defendants often will transform resentment at being convicted into allegations of perjury by the state's official witnesses," thus imposing "significant burdens on the judicial system and on law-enforcement resources," he wrote.

Justices Thurgood Marshall, Harry A. Blackmun and William J. Brennan Jr. dissented in Briscoe et al. vs. Lahue et al. Marshall, joined by Blackmun, said the Civil Rights Act of 1871 was specifically designed to abrogate "any absolute immunity for government officials involved in the judicial process, including police officers."

The housing ruling yesterday came in the case of Onilea Neal, the recipient of an FmHA loan for a prefabricated house. The agency, like other government lending agencies, inspects a property serving as security for the loan.

An FmHA inspector approved Neal's house. After she moved in, she discovered 14 major problems, including defects in materials and workmanship. When the builder refused to pay for the repairs, she sued the government, claiming its failure to exercise "due care" in its inspection constituted negligence.

In that case and others like it, the government has relied on a provision of the Federal Tort Claims Act that bars suits stemming from "misrepresentation" by its officials. But Marshall, writing for the court, said the misrepresentation exception did not apply in Block vs. Neal because Neal was not claiming any "misstatements" by FmHA officials. That does not necessarily mean the government is liable, he said, just that Neal's suit was not barred.

Government lawyers said the decision knocks out one defense they use against similar suits involving other forms of government inspection. It is, for example, one of three grounds the government has put forward to fight off a more far-reaching suit that stems from an air crash and is awaiting Supreme Court action.

Relatives of crash victims sued the Federal Aviation Administration, claiming it was financially responsible because it certified the plane's airworthiness. Officials appealed an unfavorable decision of the 9th U.S. Circuit Court of Appeals. They said yesterday that case, U.S. vs. United Scottish Insurance Co., et al., could have a much broader impact.