WASHINGTON — No one was happier than Danny Murphy, a Mississippi soybean farmer with 1,500 acres, when the Senate on Tuesday passed a farm bill that expanded crop insurance and other benefits for agribusiness. “It’s a relief,” Mr. Murphy said.

Few were as unhappy as Sheena Wright, the president of the United Way in New York, who expects to see a surge of hungry people seeking help because the bill cuts $8 billion in food stamps over a decade. “You are going to have to make a decision on what you are going to do, buy food or pay rent,” Ms. Wright said.

The long-stalled farm bill, which represents nearly $1 trillion in spending over the next 10 years and passed on a rare bipartisan vote, 68 to 32, produced clear winners and losers. Over all, farmers fared far better than the poor.

The nearly 1,000-page bill, which President Obama is to sign at Michigan State University on Friday, among other things expanded crop insurance for farmers by $7 billion over a decade and created new subsidies for rice and peanut growers that would kick in when prices drop. But anti-hunger advocates said the bill would harm 850,000 American households, about 1.7 million people spread across 15 states, which would lose an average of $90 per month in benefits because of the cuts in the food stamp program.