A report released Thursday by Comptroller Tom DiNapoli’s office found farms in New York generated $5.7 billion in revenue in New York in 2017.

The report reviewed the economic impact of 33,400 farms in the state, which employed more than 55,000 workers in the studied year.

Farms cover nearly 23 percent of New York’s total land area. Almost all, 96 percent, are family owned.

“Agriculture is an essential part of New York’s economy,” DiNapoli said. “Farms generate billions of dollars in sales, provide jobs and enhance our quality of life. But farmers face challenges including fluctuating milk prices, threats from a changing climate and disrupted trade relations. We need to build on our previous actions to make sure that agriculture can thrive in the Empire State for generations to come.”

Farms have struggled in recent years, showing a decline in both farms and acreage between 2007 and 2017. Farmers are also facing new labor regulations that will require them to pay workers overtime and allow them to collectively bargain.

Still, the number of certified organic farms have grown by 60 percent between 2012 and 2017.

New York remains a top producer in areas like dairy production, ranking third in sales nationwide in 2017. New York is second in the production of apples and maple syrup, and third in grapes and 11th in beer sales.