(Reuters) - North Dakotans on Tuesday soundly rejected a law enacted last year that changed decades of family-farming rules in the state by allowing corporations to own and operate dairy and hog farms.

Some 75 percent of North Dakotans who went to the ballot box voted to repeal Senate Bill 2351, according to preliminary results posted on a state website.

The law, signed into law in March 2015 by Republican Governor Jack Dalrymple, exempted dairy and swine production from the state's Depression-era corporate farming prohibition.

The North Dakota Farmers Union and other groups that collected signatures to put the referendum on the ballot said family farmers cannot compete with large agricultural firms with no ties to the communities where they operate.

"Thank you, North Dakota," the farmers union said on Twitter.

Supporters of the bill argued that dairy and pork operations are on the decline in the state and cannot survive without corporations that can finance expensive equipment and compete regionally, according to the Yes for Dairies & Pork Producers website.

Corporate and foreign control of U.S. farmland has been a hot-button issue in several major agricultural states in recent years as a multi-year commodities boom that began in 2007 has attracted non-farm investors.

State laws prohibiting corporations and foreign entities from owning U.S. farmland complicated a $4.7 billion acquisition in 2013 of U.S. pork producer Smithfield Foods by China's Shuanghui International. The deal ultimately closed.

This February, a U.S. district judge issued an injunction barring Nebraska officials from enforcing the state's ban on farmland ownership by corporations.

The referendum was the only measure on the state's primary ballot, which was dominated by a Republican fight for the governor's office. In the Republican primary for governor, Doug Burgum defeated North Dakota Attorney General Wayne Stenehjem, results on the state's election website showed.

North Dakota, with about 740,000 residents, has a heavily agricultural economy, producing cereal grains and oilseeds.

It is one of nine states that have laws limiting corporate farming, according to the National Agricultural Law Center. The North Dakota law says farming or ranching companies must have no more than 15 shareholders or members who must belong to the same family, to a distance of first cousins.

(Reporting by Fiona Ortiz and Karl Plume in Chicago; Editing by Dan Grebler)