(06-06) 16:53 PDT WASHINGTON -- The U.S. Supreme Court rejected a challenge Monday to a California law granting college tuition discounts to high school graduates in the state, regardless of immigration status - a law that saves illegal immigrants, among others, nearly $23,000 a year at UC campuses.

The 2002 law, intended to encourage youths to attend college, enables illegal immigrants and out-of-state residents to pay the same lower fees as California residents if they attended high school for three years in the state and graduated.

At the University of California, in-state fees total $11,300 a year, while non-Californians pay $34,000. The savings are $11,160 a year at California State University and $4,400 a year at the community colleges.

A group of 42 out-of-state residents paying the higher fees at California colleges said in a 2005 lawsuit that the statute violated a 1998 federal immigration law. That law prohibits states from providing any benefits to illegal immigrants based on their in-state residence, unless the state makes the same benefits available to U.S. citizens elsewhere.

But the state Supreme Court unanimously upheld the law in November, ruling that the lower fees were based on immigrant students' high school graduation, and not merely on their residence in California.

It was the first ruling in the nation to address such a law. Eleven other states have similar statutes.

The plaintiffs appealed to the nation's high court, which is being drawn into the conflict over state and federal regulation of immigration.

Last month the court, in an Arizona case, allowed states to impose more severe penalties than the federal government on employers of illegal immigrants. On Monday the justices ordered a lower court to reconsider a law in Hazleton, Pa., prohibiting illegal immigrants from renting homes. An Arizona law requiring police to examine immigration documents of people they arrest could reach the court next year.

The court denied review of the California case without comment.

"This is a good day for higher education and for California high school graduates," said Ethan Schulman, UC's lawyer in the case.

Of the 2,000 UC students paying lower tuition under the 2002 law, he said, about one-third are illegal immigrants, and the rest are U.S. citizens or legal residents who attended high school in California and now live elsewhere.

Michael Brady, a lawyer for the 42 plaintiffs, said the California statute "undermines ... the federal law, which was intended to prevent illegal immigrants from getting in-state tuition."

The case is Martinez vs. Regents of the University of California, 10-1029.

Chronicle staff writer Nanette Asimov contributed to this report.