PRESQUE ISLE, Maine — President Barack Obama on Friday signed a $956 billion farm bill that is expected to give a boost to farmers in Maine but includes cuts to the food stamp program.

Obama signed the bill at Michigan State University during a speech in which he spoke of the benefits of a thriving agricultural sector for the nation’s overall economy. Lawmakers passed the legislation this week after four years of contentious arguments over farming subsidies and efforts by Republicans to reduce financing for food stamps.

The final bill replaces direct crop payments with an insurance program and trims $8 billion from food stamps over the next decade, which is much less than the $40 billion cut some Republicans had called for. In Maine, it provides $30 million for the Farmers Market Promotion Program, which gives federal grants to improve or expand farmers markets, community-supported agriculture and other direct-to-consumer programs. It provides $13 million to help farmers cover the costs of certifying their crops as organic. It also expands the capability of recipients of Supplemental Nutrition Assistance Program benefits, also known as food stamps, to use their electronic benefit transfer cards for purchases at farmers markets and through community-supported agriculture programs, among other things.

Sen. Susan Collins voted against passage of the bill, even though she admitted supporting some elements of it, such as funding for agricultural research, conservation and forestry programs. She said much of her decision rested on the fact that it lacked support for Maine’s dairy farmers.

“Once one of Maine’s most important agricultural industries, just 287 dairy farms remain in our state today, and they are threatened because of the way the Department of Agriculture sets dairy prices,” Collins said in a statement. “I authored a provision that was supported by Maine’s dairy farmers and originally included in the Senate-passed farm bill last year that would reform this process. Unfortunately, this provision was not included in the final bill.

“In addition, this bill does not do enough to cut massive, wasteful taxpayer subsidies for large agri-businesses in the South and West that come at the expense of small, family farms in the Northeast,” she added. “While family farmers struggle to make ends meet, this bill leaves in place loopholes that allow multimillionaire agri-businesses to receive subsidies at taxpayer expense.”

Sen. Angus King voted to support the bill, but he added he was disappointed SNAP was cut by $8 billion. He said he was “particularly frustrated that the final bill does not include Sen. Collins’ provision to initiate a process to restructure the outdated milk-pricing system, which continues to negatively impact Maine’s small dairy farmers.” But he added that the former food stamp program could have been cut by $40 billion, which he called “unacceptable.”

“Farmers across Maine, including our apple, blueberry and potato growers, will benefit from the increased funding for specialty crop block grants, while additional funding for the Farmers Market Promotion Program will support local farmers as they strive to provide healthy, locally grown foods through the thriving farmers’ market movement in Maine,” he said.

U.S. Rep. Mike Michaud also supported the bill, even though he said it was not “perfect.”

“It contains provisions that are critical to our crops, including potatoes, and it makes a historic investment in conservation programs,” he said in a statement. “It’s also a boon to our state’s organic farmers and continues support for Maine’s growing biomass industry.”

Michaud said the farm bill contains a 55 percent increase in new resources dedicated to important potato industry priorities, including funding for specialty crop research, specialty crop block grants and money to promote U.S. agriculture in foreign markets.

Tim Hobbs, director of development and grower relations for the Maine Potato Board, was happy with those provisions of the measure.

“The bill contains the most significant government investment ever in the specialty crop industry of which the Maine potato industry is a part,” he said. “The Maine potato industry appreciates the role that Rep. Michaud has played in moving this important piece of legislation forward.”

U.S. Rep. Chellie Pingree voted against the bill, even though she said it included a number of “local-foods” and organic-crop initiatives she had fought to secure for years. Pingree said that the bill cuts food stamps for the neediest families, doesn’t do enough to create real reform to crop subsidy programs and creates loopholes that guarantee income for big agri-businesses.

“This farm bill is a real missed opportunity,” Pingree said. “Subsidies for the biggest farms were protected, while help for struggling families was cut. Even bipartisan provisions that would have created real reform in crop subsidy programs were stripped out of this bill at the eleventh hour — and loopholes that would allow the largest agri-businesses to collect almost unlimited payments were included.”

Pingree said she wanted to support the bill, but in the end, found it “just too much of a giveaway to corporate special interests.”

Whitcomb also said he found a number of aspects of the bill troubling, including what he felt were important reforms that were included in the original Senate bill. He said that entitlement and natural resource programs widely used in Maine were curtailed, while subsidies to wealthy farmers, particularly in the southern and western regions of the country, were not.

“It’s equally disappointing that House and Senate conferees did not accept the provision that Sen. Collins authored that would have begun a process for examining the flawed federal milk pricing system, which is extremely important for all Maine dairy farmers,” he said.

But for those who grow blueberries, officials felt the bill would be helpful.

David Bell, executive director of the Wild Blueberry Commission of Maine, was happy to see it passed.

“The farm bill is particularly important to the rural economy of Maine,” he said. “For example, 60,000 acres of wild blueberries bring over $250 million per year into the state and support over 2,500 jobs. The Specialty Crop Title of the farm bill will help support University of Maine research and Cooperative Extension education to help growers improve the sustainability of their crop — and our Maine economy.”