[Update: Thirty Democrats in the U.S. House of Representatives banded together today to pitch a bill that would protect the PACE program detailed below. The bill would force corporations that took bailout money to stay afloat — like Fannie and Freddie — to support PACE despite their opposition.]

California State Attorney General Jerry Brown has filed a lawsuit against controversial mortgage companies Fannie Mae and Freddie Mac, and the Federal Housing Finance Agency, for opting out of a program that encourages residential solar installations.

The initiative, called Property Assessed Clean Energy, or PACE, lets local governments loan money to homeowners through property-tax assessments so that they can afford to install solar panels and energy-efficient heating systems. Local governments raise the money by selling municipal bonds, and are repaid by homeowners over the next 15 to 20 years.

Because property-tax assessments are required to be paid back before mortgage investors in the event of foreclosure, Fannie Mae, Freddie Mac and their peers are up in arms. Their regulator, the FHFA, says that PACE does not ensure that homeowners have enough money to repay all their debts, leaving them dangerously vulnerable.

As a result, both mortgage giants have said they will not accept loans aided by PACE, even though the program has already won broad federal support and generous stimulus funding.

Brown, the Democratic nominee for California governor, says he filed the lawsuit so that the mortgage companies don’t get away with killing a program that could improve the state’s environment, boost its renewable energy generation, and create thousands of new jobs. His supporters say they will push for federal legislation to ensure PACE’s future.

If California wins the suit against Fannie and Freddie, both companies will be required to recognize PACE loans.