"We'd written her off," said a pleasantly surprised news media lawyer, Bruce W. Sanford, upon hearing last week that Justice Sandra Day O'Connor had cast the deciding vote in favor of the press in a libel ruling.

O'Connor's vote with the liberal wing also stunned conservatives, such as American Legal Foundation lawyer Michael McDonald. "I am surprised and disappointed," he said.

Last week's ruling, requiring plantiffs in libel suits to assume the difficult burden of proving that a published story was false, was one of several this term in which O'Connor abandoned her usual allies on the court's conservative wing and cast the pivotal vote to create a liberal majority on a major issue.

In O'Connor's view, the press deserved substantial protection from libel suits because "the First Amendment requires that we protect some falsehood in order to protect speech that matters."

The dissenters, this time led by centrist Justice John Paul Stevens, called her opinion "pernicious" and said it would give "the character assassin a license to defame."

O'Connor's voting record this term, as the court approaches the halfway mark, hardly makes her a new member of the court's centrist bloc, much less its liberal wing.

But President Reagan's only appointee to the high court, who in her first years sided consistently with the most conservative of her colleagues, has become considerably less predictable, a change that is attracting notice.

The court is generally seen as split into three groups on controversial social issues, with Chief Justice Warren E. Burger, William H. Rehnquist and O'Connor on the right and Justices William J. Brennan and Thurgood Marshall on the left. Justice Byron R. White, although lately increasingly conservative, along with Justices Lewis F. Powell, Stevens and Harry A. Blackmun have formed "a floating center."

During her first term on the court in 1981-82, O'Connor voted with Rehnquist, a fellow Arizonan and longtime friend, 81.7 percent of the time, according to statistics compiled by the Harvard Law Review. Two years later, she voted with Rehnquist 91.9 percent of the time and joined him 90.5 percent of the time last year.

So far this term, with nearly 60 of the court's 150 cases decided, she has sided with Rehnquist just less than 80 percent of the time.

When she arrived at the court, O'Connor agreed with Brennan in less than half the court's rulings. This term she and the liberal justice find themselves in agreement about 60 percent of the time.

Statistics, especially this early in the term, can be misleading. The difficult cases for the most part have yet to be decided, while the less divisive ones, which are unanimous or nearly so, often come down early.

Still, the preliminary pattern is supported by several votes where O'Connor abandoned conservatives when it mattered most -- when the court was closely divided on highly symbolic issues such as school prayer, federalism or libel.

Those votes indicate that O'Connor, 56, is adopting a more independent, pragmatic, case-by-case conservatism. She appears as much or more concerned with the process used to reach a result than the particular result reached.

That concern for process was illustrated last month when she denied conservatives a major victory in a case involving the constitutionality of voluntary prayer groups in public schools. O'Connor joined the court's liberals in a 5-to-4 ruling that said the person challenging the prayer group in Williamsport, Pa., a former school board member, had no legal basis to do so.

The ruling let the prayer group in Williamsport's high school continue, but, at least temporarily, deprived conservatives of a ruling they wanted saying such religious groups were constitutionally permissible.

O'Connor also backed the liberals on the losing side of a case involving the power of the military to enforce strict dress codes -- in this instance whether the Air Force could deny an Orthodox Jewish captain's request to wear a yarmulke while in uniform.

The 5-to-4 majority, in an opinion by Rehnquist, said the judiciary should as a general rule defer to the military's "professional judgment" and the Air Force decision not to permit the yarmulke overrode the captain's claims to a First Amendment right to freedom of religion.

O'Connor, in a dissent, said the "need for military discipline . . . is unquestionably . . . important," but the military is still subject to constitutional constraints.

In this case, she concluded, "I would hold that the government's policy of uniformity must yield to the individual's assertion of the right of free exercise of religion."

On other occasions, O'Connor, while agreeing with the result reached by one side or the other, has written her own opinions generally objecting to the sweep of the majority opinion.

For example, in a criminal case involving government violations of grand jury rules, O'Connor agreed with the conservatives that later convictions in this case should not be overturned, but said: "I write separately because I believe the analysis adopted by the majority" -- an analysis written by Rehnquist -- "seriously undermin[es] the grand jury's traditional functions of protecting the innocent from unwarranted public accusation."

O'Connor's shift -- if it is one -- is not unusual for justices. Blackmun, a member of the court's center who often sides with the liberals, began his tenure in the early 1970s as a consistent ally of Burger, his fellow Minnesotan. They voted so often together that they came to be known as the "Minnesota Twins," a sobriquet that infuriated Blackmun.

O'Connor's mini-odyssey is much less dramatic, but it is quite evident to some observers, such as John P. Frank, a law professor and court expert from O'Connor's home town of Phoenix who has followed her career closely.

"The tradition is that it takes five years for a new justice not previously part of the federal system to stand on one's own," Frank said, noting that O'Connor's previous judicial experience had been on a state court.

"I have been predicting that at about the end of five years that, as a superbly capable lawyer, she would be flying off on her own," Frank said.

O'Connor's independent views were evident early in her tenure, but they most often led her to agree in general with her fellow conservatives. More recently they seem to be leading her to disagree.

O'Connor is the court's junior justice in terms of tenure. That often translates to limited influence in shaping opinions. But fellow justices across the ideological spectrum say privately, and sometimes publicly, that they find her hardworking and perceptive and that they consider her views carefully.

Despite her junior status, O'Connor has been known to write opinions that occasionally lead more senior justices to shift their votes, and the eventual outcome of a case, her way.

"Justice O'Connor," Frank said, "has now been there long enough to be an independent force. But she will remain a staunch conservative, make no mistake about that."

Frank, who has known O'Connor for years, said, "We can anticipate less echoing of Justice Rehnquist and much more standing on her own two feet from here on out. But she is Reagan's prime appointee and she's given them about what they wanted."