Sonoma County has sued federal housing officials and agencies for new rules that it maintains have undermined its energy retrofit program and harmed participating homeowners.

The lawsuit, filed Monday in federal district court in San Francisco, is similar to a lawsuit filed earlier this month by the state of California.

At issue is whether the federal agencies have the power to set rules affecting home loans on properties where the owners have participated in the retrofit programs, commonly know as Property Assessed Clean Energy, or PACE.

Sonoma was first in the nation to launch a countywide program, but many other California communities this year were scheduled to launch similar efforts before the controversy arose.

On July 6 the Federal Housing Finance Agency weighed in with a statement that such retrofit programs around the nation "present significant risk to lenders." The statement urged the federally controlled mortgage agencies Fannie Mae and Freddie Mac to take steps to "protect their safe and sound operations."

Since then 21 applicants have withdrawn from the Sonoma County Energy Independence Program, according to the county's lawsuit. Several property owners in the program have been unable to refinance their homes or sell without first paying off the full amount owed to the county.

The actions by the federal officials "create substantial uncertainty for SCEIP participants going forward and are likely to prevent future participation by many county property owners," the lawsuit stated.

The county program provides financing for homeowners and businesses for such improvements as solar energy systems, insulation and more efficient windows. The building owner repays the debt twice a year along with other property taxes.

The county and other local and state agencies consider the debt an assessment, similar to any other property tax. The federal housing officials consider the retrofit program debt a loan.

The county sued the Federal Housing Finance Agency, the Federal Home Loan Mortgage Corporation, the Federal National Mortgage Association and their acting executives.

"The federal government has not done its job in justifying its actions," said Phyllis C. Gallagher, a deputy county counsel.

The suit asks the federal court to issue a temporary restraining order and other injunctions to restrain Fannie Mae or Freddie Mac from any adverse actions that would harm the energy program or those who want to participate in it.

The county suit eventually may be consolidated with the state lawsuit, Gallagher said.

A spokeswoman for the Federal Housing Finance Agency declined comment on the suit.