NEWARK, N.J. - An appellate court ruling has given a boost to New Jersey's farmland preservation program by allowing the state to buy land from a Gloucester County farmer for a "substantially similar" price as that offered by a developer.

The 3-0 ruling by a State Appellate Division panel said the state's offer does not need to be identical to prevail.

The decision comes as New Jersey, the nation's most densely populated state, strives to maintain an agricultural industry eroded by burgeoning development. Farmers can typically reap a windfall by selling their land to home builders.

State Attorney General Stuart Rabner said the ruling is a "significant victory" for New Jersey, regarding farmers who sign on to preservation programs.

The decision was "an affirmation of our legal position that the state has the right of first refusal to purchase and preserve critical farmlands in our state," Rabner said in a statement issued yesterday.

The decision, filed Thursday, reverses a ruling by a state judge who rejected an effort by the State Agriculture Development Committee to halt the sale of a farm to a home developer.

The case involving the farm of Edward J. and Susan J. Sturgis in South Harrison Township now returns to State Superior Court Judge David W. Morgan.

Morgan will likely have an "equivalency hearing," said S. David Brandt, a lawyer for the Sturgises and developer Bruce Paparone Inc.

He noted that the developer had offered $2.88 million for 120 acres, but that the state had so far offered only $2.28 million, a $600,000 difference.

"I don't know how you can make that much of a difference match, as the statute requires," Brandt said. "Who decides if it's equivalent? The property owner or the judge?"

Edward J. Sturgis thinks he is the best judge. He and his wife bought the 141-acre property in 1988 to grow trees for his landscaping business on about a dozen acres. He rents the rest to a vegetable farmer.

"I just bought this as a place to live, and some future investment," Sturgis said in a telephone interview.

The Sturgises signed on to the state eight-year preservation program in 1997. If the property were to be removed from agricultural production within that period, the state would have "first right and option to purchase the land upon substantially similar terms and conditions," according to the preservation statute.

In the meantime, the farmer can apply for state grants. The Sturgis property received more than $25,000 for an irrigation system.

Over the last few years, Sturgis received near-weekly offers for his land, and in 2003, agreed to sell 120 acres to Paparone.

Paparone, who got approval to construct 72 homes, typically sells them for $375,000 to $500,000, Sturgis said.

"I am all for farmland preservation," said Sturgis, 55, who retired two years ago. "But I think it should be my choice as a landowner to do what [I want] with the land."

About 271 farms made up of 17,000 acres are enrolled in the eight-year preservation program, said Hope Gruzlovic, a spokeswoman for the State Agriculture Development Committee.