A San Francisco judge refused Friday to block the sale of 11 state office buildings and other properties, including the California Supreme Court headquarters, rejecting arguments that the deal - a long-term money-loser, according to one state assessment - is an illegal gift of taxpayer funds.

Superior Court Judge Charlotte Woolard also disagreed with opponents' claim that the sale of two court buildings requires advance approval from leaders of the state's judiciary. Joseph Cotchett, lawyer for two former state Building Authority members who challenged the deal, said he would ask an appeals court to intervene before Wednesday, when the sales are tentatively scheduled to close.

The properties include the courthouse on McAllister Street and the state Public Utilities Commission building on Van Ness Avenue, both in San Francisco, and offices in Oakland, Santa Rosa and Los Angeles. The Legislature voted last year to let Gov. Arnold Schwarzenegger sell the buildings and lease them back for state use for at least 20 years, generating $1.2 billion in short-term cash to reduce the mounting state deficit.

But the Legislature's nonpartisan fiscal analyst said the deal would worsen the deficit over a 35-year period, with a net loss of $1.4 billion in lease payments and the equivalent of 10 percent interest.

State Treasurer Bill Lockyer and Controller John Chiang opposed the sale, and it was contested in court by two members of the State Building Authority in Los Angeles who were removed by Schwarzenegger after voicing their opposition.

The lawsuit argued that the transactions violated laws against the waste of state funds and also amounted to an illegal gift of state assets.

"The terms of the transaction are so one-sided that it amounts to a guaranteed profit for the purchasers," said Anne Marie Murphy, another lawyer for the plaintiffs.

But Woolard agreed with the Schwarzenegger administration that state officials and lawmakers were entitled to decide whether the sale was in the state's interest.

She also said the sales of the two court buildings did not require approval from the Judicial Council, the policymaking body for the judicial branch, because it does not own the buildings.

Eric Lamoureux, spokesman for the Department of General Services, said the ruling confirmed the governor's and Legislature's decision that "we need to sell these office properties to generate revenue that is desperately needed now."

Lamoureux also said the 35-year period covered by the legislative analyst's forecast was "highly unpredictable and speculative," and that the department's own analysis found that the state would save $2 million over the 20-year minimum lease period.