ALBANY — Farm workers in New York have the right to organize and collectively bargain, according to a state appeals court's Thursday ruling that said an exclusion for farm workers in state labor law is unconstitutional.

The opinion from the Appellate Division of state Supreme Court sided with the legal argument of labor advocates who say farm workers in New York have those rights.

In a 4-to-1 ruling, the justices reversed a lower court's conclusion that farm workers were excluded from state collective bargaining rules. Thursday's opinion called that exclusion "unconstitutional as a matter of law."

The New York Farm Bureau, a defendant in the case, released a statement from its president David Fisher that said the organization "fully intends to appeal the court's ill-conceived ruling."

"We believe that the majority's conclusion is unsupportable and disregards decades of precedent," Fisher said.

Since the 1930s, farm workers have been excluded by a provision carved out in the State Employment Relations Act, which the plaintiffs in the case argued was designed to discriminate against black workers during the Jim Crow era.

Crispin Hernandez, a farm worker who claimed he was fired from his job on a dairy farm in Lewis County for trying to organize in pursuit of better working conditions, challenged the law in 2016.

The suit was dismissed in January 2018 by state Supreme Court Justice Richard J. McNally Jr., who ruled the law was not discriminatory. Hernandez appealed to the appellate division last year.

"This is a victory for farm workers, as we have finally had our day in court," Hernandez said Thursday. "All workers deserve to have a voice and be heard at their place of work, and farm workers deserve to be treated with respect and dignity."

When the case was filed in 2016, Gov. Andrew M. Cuomo's administration said it didn't want to fight it. On Thursday, Cuomo and Attorney General Letitia James applauded the decision.

"This is a victory for some of the most vulnerable members of New York's workforce," said Cuomo. "From the beginning, we chose not to defend against this lawsuit because farm workers never should have been denied the same basic rights as other workers and we believed this to not only be morally wrong, but also unconstitutional."

With the state on the sidelines, the Farm Bureau asked the court if it could step in to defend the law.

The Farm Bureau's appellate court filings argued that the government didn't extend collective bargaining rights to farm workers because laborers who chose to strike during picking season could financially cripple farmers. The bureau also said the solution should be addressed in the state Legislature, which has failed to address the question despite years of advocacy.

The Farmworkers Fair Labor Practices Act, which would give farm workers the right to unionize and guarantee a day off and overtime pay, has been introduced repeatedly over the past two decades but was never passed. This year, the bill is gaining momentum after the Democratic takeover of the state Senate, and three hearings were held across the state recently to discuss the proposed measure.

State Sen. Jessica Ramos, who sponsored the bill and chairs the chamber's Labor Committee, said in a statement Thursday that it's "now the rule of law that farm workers deserve comprehensive workers' rights in New York."

The Farm Bureau and its members have argued the bill's provisions would increase labor costs on farms by nearly $300 million.

Fisher said that "if the legislature, and now the courts do not recognize the value of preserving a viable and economically sustainable food production system in the state, New York agriculture will continue to shrink under a mountain of mandates."

He added that "New Yorkers will find it harder to access New York grown food, instead relying on food brought in from out of state, or worse yet, out of the country to feed their families."

Labor advocates point to the $4.8 billion the state's farms generated in revenue in 2017 as evidence that farmers can afford to increase worker pay or implement overtime pay.

Angela Cornell, director of the Labor Law Clinic at Cornell Law School, described the court's decision as a "step forward for some of the most vulnerable workers in our communities."

"The language in the constitution is very clear — it's without qualification: Employees have the right to organize and to bargain collectively," she said.

The Farm Bureau has highlighted census data that shows a continued reduction in the number of farms in New York and the state's average net farm income of $42,875, which is below the national average.

But Cornell said farm workers' right to organize doesn't mean farm expenses will immediately and dramatically increase.

Although Farm Bureau officials have argued that workers will be able to strike during picking season, Cornell pointed out that a labor contract could include provisions that prevent farm workers from striking during certain times of the year.

A 2017 report by the the Workers' Center of Central New York and the Worker Justice Center of

New York found that 69 farmworkers died while working in New York's dairy industry between 2006 and 2016.

Cornell said that aside from a pay raise, workers will now be able to negotiate for things like safer working conditions.

"The workers, if they decided to organize ... it will give them an opportunity to have a seat at the table and negotiate over things that are important, like health and safety issues and housing," Cornell said.

"We shouldn't (deny) fundamental rights to workers because we're concerned that potentially there could be an incremental increase in the expenditures of farmers," she said. "It's always the case that business has opposed every single piece of employment legislation for decades."

Labor groups also hailed Thursday's decision.

Mario Cilento, president of New York State AFL-CIO labor federation, applauded the appellate court's decision "upholding the New York State constitution and affirming that in this state, organizing and collective bargaining are fundamental constitutional rights that farm workers cannot be denied."

"Farm workers deserve to be treated fairly and with dignity and respect," Cilento said in a statement. "Allowing them to join a union is the first step in the right direction to give them a voice on the job."

Correction: An earlier version of this article included an incorrect first name for the president of the New York Farm Bureau. He is David Fisher.