California egg producers could receive significant help from a historic agreement for housing chickens announced Thursday in Washington between farm and animal rights groups.

The agreement between the Humane Society of the United States and the United Egg Producers calls for a national law that by 2029 would essentially double the size of caged space provided for the United States' 285 million laying hens.

For California farmers, who must comply with a voter-approved initiative, the proposed federal law could provide more certainty on the size of cage systems required here by 2015, backers said.

However, Thursday's pact also includes a big risk for the state's egg farmers. If Congress fails to pass a law, California egg producers once more could be forced to look to the courts for a ruling on exactly what size cages would be allowed under Proposition 2, which was approved by voters in 2008.

Under such a scenario, the agreement "blows up in our face," said Petaluma egg farmer Arnie Riebli. The state's farmers, he said, must spend hundreds of millions of dollars to upgrade their cage systems and Congressional delays will make it harder for them to meet the initiative's 2015 deadline.

Egg producers and the Humane Society have been longtime adversaries on what constitutes humane hen houses. In California, the Humane Society trounced egg farmers by persuading 63 percent of the state's voters to approve Proposition 2. That law doesn't specify a space requirement but says each bird must have enough room to flap its wings without touching other hens.

In recent weeks, the two groups met and negotiated their agreement. One impetus was a Friday deadline for the Humane Society to file signatures for a Washington state ballot initiative. Humane Society CEO Wayne Pacelle said his group now will forego that effort, as well as a similar one in Oregon.

Both sides characterized the agreement as benefitting hens and the egg industry. They also said they each saw reasons to compromise in order to jointly seek national rules.

Pacelle said about half the states in the U.S. don't have a method that lets voters directly pass laws.

"We just couldn't achieve what we wanted through the initiative process," he said.

Meanwhile, egg producers around the nation have faced "incredible uncertainty" since Proposition 2 passed, said Chad Gregory, senior vice president for United Egg Producers, which represents about 80 percent of the nation's egg production.

"This provides certainty for our egg farmers to know what our future is like," he said.

Most of the nation's laying hens now live in cages that provide 67 square inches per bird. Under the agreement, that number would rise within 18 years to 144 square inches for larger brown hens and slightly less for white hens.

The new cage systems also would provide perches, nesting boxes and scratching areas. Producers estimate it would cost about $4 billion to switch to the new systems.

In California, by 2015 farmers would be required to provide 134 square inches for brown hens. They must attain the higher national standard in 10 years, eight years before the rest of the country. But the agreement would keep alive a law requiring out-of-state producers to meet the same standards for all eggs sold in California.

The two sides still dispute what Proposition 2 requires. If Congress enacts the law, the disagreement becomes moot, said Jonathan Lovvorn, the Humane Society's chief counsel.

But if Congress does nothing, he said, "then we're back to the big fight in California."

Assemblyman Jared Huffman, D-San Rafael, author of the law covering eggs from other states, praised the agreement for its potential to resolve the issue. But he urged Congress to quickly pass the law so California egg farmers understand what's required of them.

"They really need to know," Huffman said. "They've got a huge deadline approaching quickly and they've got millions of dollars of investments that need to be made."

Riebli, a partner in Petaluma's Sunrise Farms, said his current cages provide the standard 67 square inches per bird.

He voiced concern that the agreement requires the state's farmers to eliminate their current cage systems years before the rest of the country. But he still prefers the agreement over the initiative.

"I'd rather have this because I know what it is," Riebli said. "I don't know what Prop. 2 is."