Microsoft Corp. won a resounding victory in its antitrust case yesterday as a federal judge here rejected and at times belittled efforts by state prosecutors to impose stiffer sanctions on the company than it had agreed to in a settlement with the Justice Department.

U.S. District Judge Colleen Kollar-Kotelly embraced, with minor changes, the settlement struck last winter aimed at addressing Microsoft's violations of antitrust laws. Her series of rulings, the latest in the most bitterly fought antitrust case in a generation, represents a remarkable legal turnaround for a company that two years ago faced the prospect of being broken up.

The agreement, which imposes a series of restrictions on Microsoft's business practices, was widely assailed as a sellout and filled with loopholes by an array of legal scholars and Microsoft's corporate competitors. Nine states and the District of Columbia refused to sign on to the deal and pursued the additional sanctions, arguing that Microsoft was a serial lawbreaker that could not be trusted to live by a weak, vague agreement.

A federal appeals court ruled last year that Microsoft had committed numerous anti-competitive acts in quashing a rival Internet browser and other technologies, and the states asked the judge to protect technologies that might not yet pose a threat to Microsoft but might one day soon in the fast-moving digital age.

But Kollar-Kotelly sided fully with the computer software company and the Justice Department, which interpreted the appeals court ruling as limiting sanctions to those that stopped the illegal behavior. And she all but ridiculed the states for the legal theories they put forth to justify tougher restrictions on the Redmond, Wash., company.

Rather than allowing the federal settlement to go forward, the judge wrote, the states "sought to gather all existing complaints regarding Microsoft's business practices and bring them before the Court at this late stage in the case." In doing so, she wrote, the states showed "little respect" for the appeals court ruling last year that upheld key antitrust findings against Microsoft but rejected others, threw out a breakup order and proscribed caution in how its violations should be rectified.

The judge also went out of her way to praise the federal settlement, which resulted from intense mediation that she ordered late last year. Nine states that were part of the original prosecution also signed on to the deal.

Rejecting many of the criticisms leveled at the agreement, Kollar-Kotelly instead called the settlement "laudable . . . for the clear, consistent and coherent manner in which it accomplishes its task."

Microsoft Chairman Bill Gates, who pledged in court testimony last spring to assiduously live by the terms of the agreement, said at a press conference that the decision "gives us the freedom to continue innovating for our customers."

Gates said the company recognizes that it faces close scrutiny by the government and competitors.

In her ruling, Kollar-Kotelly also made clear that she would be watching how effectively the agreement was being enforced and withheld final approval of the agreement until the Justice Department strengthened a provision that ensured the court's role in evaluating compliance of the deal.

In a statement, the Justice Department praised the ruling and pledged aggressive enforcement of the settlement, which would last at least five years, unless Microsoft violates the terms.

As much as the rulings were a triumph for Microsoft and the Justice Department, they were crushing defeats for the company's antagonists. In trying to put the best face on the situation, Connecticut Attorney General Richard Blumenthal said some small concessions the judge gave the states were important.

In particular, the judge expanded slightly the agreement's jurisdiction over servers, the computers that control computer networks, and allowed computer makers to configure software packages so that non-Microsoft applications could launch automatically within Microsoft's Windows operating system.

"We sought more and we got more," Blumenthal said.

Iowa Attorney General Tom Miller, who led the coalition of states that pushed the case, said it was too early to decide whether to appeal. The states already have amassed significant legal expenses in hiring the high-powered Washington firm Williams & Connolly to represent the group, though Microsoft appears to be liable for the fees, based on the judge's order.

Some legal experts said an appeal would be unlikely to succeed.

"It's not an appealable decision," said Robert Litan, a Brookings Institution antitrust expert who filed a lengthy brief criticizing the federal settlement. "She's pretty much closed the book. It looks like she gave tremendous deference to the government" and an appeals court would likely grant her that discretion.

Reaction from corporate competitors was muted. AOL Time Warner Inc. General Counsel Paul Capuccio criticized the ruling but said he hoped that a pending antitrust case at the European Commission, along with class-action lawsuits and private actions brought by AOL and Sun Microsystems Inc., would help keep some reins on Microsoft.

Legal analysts said they were particularly struck by how thoroughly Kollar-Kotelly rejected the states' core theory of the case. The states argued that especially in fast-moving technology markets, where a software application that seems insignificant can quickly become a competitive threat, such nascent technologies needed protection even if they were not directly the victims of antitrust violations. And they argued that the appeal's court ruling supported this view.

"Her opinion is a very cautious and pinched view of the role of remedy in a monopolization case," said Steven Salop, an antitrust expert at Georgetown University who was a government prosecutor. He said he hopes the states appeal, perhaps even to the U.S. Supreme Court.

Mark Ostrau, head of the antitrust practice at the law firm Fenwick & West in Silicon Valley, said the decision demonstrates the difficulty of making antitrust law work with technology.

"If there is any precedent at all that it sets, it's that the regular legal process is incompatible with the high-tech industry, and if someone seriously expects to get material legal remedies they have to be done very quickly, cleanly and to the point," he said. "Laser shots, rather than shotguns."

The states asked for several measures that went much further than the original anti-competitive conduct. Essentially, they asked the judge to realize that in an increasingly networked world, it would not be enough to simply halt Microsoft's prior actions. Technology was moving on, they argued, and Microsoft was continuously seizing the advantage.

In particular, the states asked that if Microsoft sells Windows bundled with other applications, it must also be forced to sell versions of its operating system that do not include the programs. The states' theory is that forcing Microsoft to remove the applications, rather than giving people the option to hide them, enables all makers of applications to compete fairly for space on the Windows desktop.

Such unbundling, Microsoft said, would be technically impossible to achieve, and it would grievously damage the company.

The states also sought to require Microsoft to make public all the code for its Internet Explorer, in effect allowing it to become an open-source software product that the software engineering community could build upon. Microsoft said such a move would constitute theft of its intellectual property.

But Kollar-Kotelly would have none of the state's arguments.

Under the federal settlement with Microsoft, the company will have to disclose more of its computer code to enable rival applications to operate with Windows; it will have to give computer makers and users the ability to mask Windows applications, such as the Internet browser and digital media player, and not impede the installation of rival programs; and the company is prohibited from retaliating against computer makers or other vendors who use competing software.

Microsoft's battles with the government date to 1994, when the Justice Department first filed suit against the company for illegal business practices relating to its Windows monopoly. Like last year, the two sides settled the case, agreeing to some restrictions on the company.

In 1997, the government filed charges claiming that the company had violated the terms of the agreement, a case the government eventually lost.

In 1998, under then-antitrust chief Joel Klein, the government filed a massive new suit, in conjunction with a similar case brought by 20 states. The suits were consolidated for the purpose of a trial, which was held by District Court Judge Thomas Penfield Jackson in Washington beginning in October 1988.

The government charged Microsoft with a raft of anti-competitive acts that helped it gain and protect its hammerlock on the personal computer software market. Microsoft was accused of quashing competitive threats posed by Netscape Communications Corp.'s Internet browser and Sun Microsystems' Java technologies; of withholding crucial computer code that allows rival software programs to operate with Windows; of having exclusive and illegal licensing provisions; and of strong-arming computer makers into using Microsoft applications in favor of those made by rivals.

At the end of a nearly three-month trial, Jackson ruled that Microsoft had violated the Sherman Antitrust Act in three key areas, including illegally protecting its operating system and illegally attempting to monopolize the browser market. Jackson also adopted the government's proposed remedies, which included breaking up the company.

Microsoft immediately appealed, and a little more than a year later the federal appeals court in Washington agreed with some parts of Microsoft's challenge.

Of the legal challenges Microsoft still faces, the most serious is likely to be in Europe. Regulators at the European Commission have issued preliminary findings that the company illegally restricted competition in the growing market for network servers and in the market for digital media players.

According to lawyers familiar with the European investigation, its competition directorate is preparing a final ruling with stiffer sanctions than those sought by the Justice Department, although the cases differ in several areas. Officials at the U.S. antitrust division, these lawyers said, have been urging the EU to mirror the settlement they struck with Microsoft.

The decision also defines the legacy of Charles A. James, the outgoing head of the antitrust division, who had staked his reputation on the agreement and his interpretation of the case.

Staff writers Jonathan Finer, Carrie Johnson and David A. Vise contributed to this report.

Attorney General John D. Ashcroft and Deborah Majoras, an assistant attorney general in the antitrust division, discuss the settlement. Microsoft Chairman Bill Gates, at a press conference, said the agreement "gives us the freedom to continue innovating for our customers."