A ballot measure approved overwhelmingly by Massachusetts voters Tuesday will lead to more spacious cages for a few thousand hens in the state. But it could have far-reaching effects on farms and the living quarters of chickens, pigs and calves across the nation.

Question 3, which was approved by 78 percent of voters in the state, prohibits farms in the state from confining any egg-laying hen, breeding pig or calf raised for veal in a way that prevents the animal from “lying down, standing up, fully extending its limbs, or turning around freely.” Variations on those sorts of requirements have been passed in a handful of other states, and local media reported that the measure would affect just one Massachusetts farm that houses hens in cages that do not meet the new standards; none confine sows or calves.

What’s different about the Massachusetts measure is that it targets farms far outside the Bay State by also banning the sale of pork, eggs or veal from producers that use the prohibited confinement practices, including products that come from across state lines. That means any U.S. farm that houses hens in the battery cages that are now the industry standard — which allot each bird a space with an area smaller than a piece of copier paper — will not be allowed to sell eggs in Massachusetts.

The new law, which will take effect in 2022, is the latest demonstration of animal welfare groups’ success in galvanizing public opposition to animal farming practices they say are exceedingly cruel. In recent years, the organizations’ campaigns and consumer pressure have prompted hundreds of major U.S. companies to swear off eggs from caged hens or pork from farms that house pregnant sows in cramped gestation crates. Activists have targeted voters with ballot measures in more liberal states, like Massachusetts, to pave the way for tougher fights in states with big agriculture sectors.

“By supporting this unprecedented measure, Massachusetts voters joined farmers, veterinarians, advocates, consumers and major food industry players in declaring that intensive farm animal confinement is barbaric and at odds with contemporary values,” said Matt Bershadker, president and CEO of the American Society for the Prevention of Cruelty to Animals, which was part of a coalition that backed Question 3. “The victory is meaningful for all of the animals whose lives it will improve, but also for what it represents: that the public’s will to protect animals from suffering is stronger than ever.”

The measure was opposed by farm industry groups that argue the confinement practices are not inhumane and say efforts to change them are part of a broader mission of the Humane Society of the United States and other groups to end meat-eating. Some advocates for the poor also fought the law, saying it would dramatically raise prices on eggs, a key protein staple. Estimates of the eventual effect on egg prices in the state have varied widely, from a rise of 12 cents to $1 per dozen, the Boston Globe reported.

“Question 3 is a regressive food tax, a social injustice that will harm those often neglected in these debates,” Diane Sullivan, who managed the coalition opposed to the measure, wrote in a recent opinion piece in the Boston Globe. “It seems cruel for people who can afford expensive tastes to raise prices for those who struggle every day to feed their families.”

The Massachusetts referendum was a broader version of a proposition passed in California in 2008, which required that egg-laying hens in the state be able to stand, lie down, turn around and spread their wings. Two years later, the state legislature passed a law imposing the same requirement on all shell eggs sold in California, which took effect at the start of 2015.

Six egg-producing states are suing California over that measure, saying it’s an unconstitutional violation of interstate commerce, and opponents of the Massachusetts measure have suggested they’ll do the same. But backers say courts have issued rulings in favor of similar laws.

Wayne Pacelle, president and CEO of the Humane Society, wrote in a blog post Wednesday that Question 3 “is the fourth anti-factory farming ballot measure we’ve waged, and, with each one, we’ve increased our margin of victory as well as the actual reach of the measure.”

The coalition supporting Question 3 spent more than $2 million on its campaign, outspending opponents by 10 times, according to State House News Service.

Among the opponents were the owners of Diemand Farm, the only farm in Massachusetts that will be affected by the new law. It says it has turkeys, 22 beef cattle and about 3,000 egg-laying hens that live in cages measuring 12 by 18 inches. In a video, farm operator Peter Diemand said the cage system prevents hens from standing in their own waste and “eliminates the problem of cannibalism” and “crowding in the corners” among hens.

The Massachusetts Farm Bureau Federation said in a statement before the vote that backers of Question 3 were “using Massachusetts farmers as pawns in an effort to raise funds and help support similar efforts in states where this is more relevant.”

Read more: