WASHINGTON — The Supreme Court ruled Tuesday that the nearly 5 million people who work for state governments are protected under a federal law intended to ease work and family conflicts, a surprising departure from the conservative-leaning court's usual stance on states' rights cases.

The 6-3 ruling was all the more notable because its author was Chief Justice William H. Rehnquist, the main architect of the court's shift away from federal control.

The court majority preserved the broad protection Congress mandated in the Family and Medical Leave Act, which guarantees workers will not lose their jobs if they take limited time off to deal with family emergencies. The 1993 law was intended to apply to all but the smallest employers and most specialized jobs, and to guarantee the same rights to both men and women employees.

The rights of private-sector workers were not at issue in Tuesday's case, but supporters of the law said exempting state government workers would seriously undercut the law.

"By creating an across-the-board, routine employment benefit for all eligible employees, Congress sought to ensure that family care leave would no longer be stigmatized as an inordinate drain on the workplace caused by female employees and that employers could not evade leave obligations simply by hiring men," Rehnquist wrote.

Justices Sandra Day O'Connor, David Souter, Ruth Bader Ginsburg and Stephen Breyer joined Rehnquist, and Justice John Paul Stevens agreed with the outcome of the case.

Congress had ample and persuasive evidence that women state employees, like women in the private sector, suffered in the workplace when work and family commitments clashed, the court concluded.

States also did no better than other employers in eliminating stereotypes about who is the family breadwinner and who is the family caregiver, the court said.

"This is important because the court is saying that there are some overriding and overreaching concerns that the federal government has a role to play in addressing, and sex discrimination is one of them," said Judith Lichtman of the National Partnership for Women and Families and a lawyer for the Nevada state worker at the center of the case.

William Hibbs, a Nevada state worker, was fired in a dispute over how much leave he could take to care for his wife, who was badly hurt in a car accident. He sued in federal court, claiming the state did not give him his full 12 weeks of family leave as required under the 1993 law.

Tuesday's ruling returns his case to a lower court, where Hibbs said he will ask for his job as a welfare case worker back. If he wins he would be eligible for back pay to 1997.

No worker should have to choose between keeping their job and meeting obligations at home, Hibbs said after the court sided with him.

"My bottom line in this whole thing is that I've done nothing wrong, I followed their procedures and I did everything they told me to do," in asking for time off, Hibbs said. "And because of that I get fired."

What might have been a straightforward case about whether one employee got a raw deal became something different when Nevada invoked the notion of states' rights, or federalism.

As the Supreme Court has interpreted it, the Constitution forbids an individual from suing a state unless the state agrees to be sued or unless Congress explicitly and justifiably allows it.

In a series of 5-4 rulings since 1995, the Rehnquist court has used that reasoning to strike down or weaken laws meant to protect women victims of violent crime and keep guns away from schools, and to protect disabled people and the elderly in the workplace.

Rehnquist and O'Connor have voted with the majority in the previous cases, including a 2001 ruling that state workers cannot sue to enforce their rights under the Americans With Disabilities Act. Many lawyers assumed the court would reach the same conclusion now.

What makes the family leave issue different, Rehnquist said, is that the Supreme Court has already ruled that Congress has the power to pass national laws that attack racial and sex discrimination, and the court views such discrimination with a different lens.

Justices Antonin Scalia, Anthony M. Kennedy and Clarence Thomas dissented. They are the other three in what some lawyers have called the "federalist five," and they saw this case as a continuation of that principle.

Congress did not demonstrate that states as a whole discriminated in granting leave, Kennedy wrote. He added a slap at the apparent about-face of Rehnquist and O'Connor.

"When the federal statute seeks to abrogate state sovereign immunity, the court should be more careful to insist on adherence to the analytic requirements set forth in its own precedents," Kennedy wrote.

The court also Tuesday:

Gave the Bush administration a major legal victory in the war on terrorism, rejecting a challenge to secret deportation hearings held for hundreds of foreigners detained after the Sept. 11 attacks. The government ordered all immigration hearings closed if the foreigners were deemed "special interest" cases.

Shielded police officers from certain lawsuits over the questioning of some criminal suspects when it ruled in the case of a farm worker shot five times by police, but splintered on how much protection police should have.

Refused to consider whether some groups have a constitutional right to exclude women.