Updated

Missouri's attorney general has asked a federal court to strike down a California law regulating the living conditions of chickens, setting up a cross-country battle that pits new animal protections against the economic interests of Midwestern farmers.

The lawsuit by Missouri Attorney General Chris Koster takes aim at a California law set to take effect in 2015 that prohibits eggs from being sold there if they come from hens raised in cages that don't comply with California's new size and space requirements.

Koster said Tuesday that the California law infringes on the interstate commerce protections of the U.S. Constitution by effectively imposing new requirements on out-of-state farmers.

"If California legislators are permitted to mandate the size of chicken coops on Missouri farms, they may just as easily demand that Missouri soybeans be harvested by hand or that Missouri corn be transported by solar-powered trucks," Koster said.

Missouri's lawsuit was filed Monday in U.S. District Court in Fresno, Calif.

California Attorney General Kamala Harris declined to comment on the suit Tuesday.

But the Humane Society of the United States, which campaigned for the ballot initiative, said in a statement that states have the right to pass laws that protect the health and safety of their residents. Jennifer Fearing, the group's senior state director for California, said eggs produced from hens in "battery cages" have a higher risk of salmonella contamination.

"Attorney General Koster's lawsuit targeting California's laws, filed just to curry favor with big agribusiness, threatens state laws across the country dealing with agriculture and food safety," she said.

California voters approved a ballot initiative in 2008 that required egg-laying hens, pigs and calves to be raised with enough space to allow the animals to lie down, stand up, turn around and fully extend their limbs. The measure gave farmers until 2015 to comply with the provisions.

After voters approved the initiative, concerns were raised that the measure would put California egg farmers at a competitive disadvantage with counterparts in other states.

In 2010, California legislators expanded the law to ban in that state the sale of eggs from any hens that were not raised in compliance with California's animal care standards. The California law cites concerns about protecting people from salmonella and other illnesses.

But the Missouri lawsuit said the real intent was to protect California farmers from being put at a disadvantage with their counterparts in other states.

U.S. Rep. Jared Huffman, a California Democrat who wrote the legislation when he was in the state Legislature, also declined to comment Tuesday.

Missouri farmers produce about 1.7 billion eggs annually and sell about one-third of those — about 540 million eggs — in California, according to Koster's lawsuit. He said that makes Missouri the second-largest egg exporter to California, behind only Iowa.

Many of Missouri's hens are raised in tight cages that won't meet California's new standards. Koster said Missouri farmers would have to spend about $120 million to remodel their cages or forgo sales to one of their most important markets, which could force some Missouri egg producers out of business.

Farm Sanctuary, an animal rescue and protection group based in Watkins Glen, N.Y., was among the organizations that helped fund the campaign for the California ballot initiative.

"It's a real embarrassment for the state of Missouri that Mr. Koster would defend a practice that is horribly abusive of animals with a legal theory that is tilting at windmills," said Bruce Friedrich, a senior policy director at Farm Sanctuary.

Missouri Farm Bureau President Blake Hurst praised the lawsuit as an important legal challenge. He said the California law, if upheld, could set a precedent in which the biggest states can effectively set agricultural policies for all the states.

"A pretty good tradition in this country that's worked pretty well is that we have free trade among the states, and we would not want to see that changed," Hurst said.