With billions of dollars at stake, hospitals are lobbying hard for Medicaid expansion in Columbus, Tallahassee and other state capitals where state legislators oppose the extension of the program to some 17 million Americans.

Hospital associations have paid for television and newspaper ads, organized rallies, and choreographed legislative testimony in support of the Medicaid expansion, which is part of the Affordable Care Act. They also have united disparate groups which are used to being on opposite sides of legislative debates. In Columbus, for example, Ohio Right to Life and Planned Parenthood Advocates of Ohio are working side-by-side to persuade state lawmakers to approve the expansion. Both groups say they want to make health insurance available to the poor.

In making their case, the hospitals tout the economic benefits that an influx of federal money will bring to the states. The federal government will cover 100 percent of the cost of the expansion for the first three years, gradually tapering off to 90 percent in 2020. And they point to the public health dividends that will come from providing health care to people who can’t afford it now.

But the hospitals also acknowledge that the expansion is vital for their own financial health. “For many hospitals it’s existential; it’s really talking about the future viability of their institutions,” said Shawn Gremminger of the National Public Hospital Association.

Democratic Sen. Christopher Smith, the minority leader in the Florida Senate, believes the precarious condition of hospitals has the best chance of winning over resistant Republicans. “It’s the plight of the hospitals that is bringing everyone to the table,” he said. “Do they want to be responsible for the shutting of Jackson Memorial? Or closings in the South Broward Hospital District?”

It is a fight that only 10 months ago, the hospital industry had hoped to avoid.

The ACA is expected to cost hospitals more than $300 billion over 10 years by reducing fee-for-service Medicare reimbursement and cutting federal payments that compensate hospitals for providing free care to the poor. In Ohio, for example, those federal changes would cost hospitals about $7.4 billion over the next 10 years.

Nevertheless, hospital associations agreed to back the law. That’s because by expanding Medicaid to some of the uninsured and requiring the rest to purchase insurance from health exchanges, the ACA promised to increase the number of people able to pay for hospital services by about 48 million. The Medicaid expansion envisioned under the ACA would cover all adults younger than 65 earning less than 138 percent of the federal poverty level.

The U.S. Supreme Court poked a stick in the spokes by upholding the ACA but making the Medicaid expansion optional for the states. Now hospitals in states that opt out of expansion will have to contend with the ACA cuts without the influx of new Medicaid patients they had expected.

“The pain part is guaranteed but the gain part depends on the choice each state makes,” said Stan Dorn, a senior fellow on health policy with the Urban Institute.

Most Republican governors initially said they would decline to participate in the expansion. Some have since changed their minds—including Arizona’s Jan Brewer, Ohio’s John Kasich, and Florida’s Rick Scott—but they must win over Republican-dominated legislatures which remain staunchly opposed. Other states with Republican governors, including Maine and Tennessee, still haven’t decided whether to expand their Medicaid programs. Neither has Arkansas, which has a Democratic governor and a Republican majority in the legislature.

Hospitals are not strangers in state capitals. According to the National Institute on Money in State Politics, the health industry spent $70 million on state legislative races in 2012, roughly the same amount spent by the finance, insurance and real estate industries combined. Rarely, though, do hospitals get involved in a battle with such high visibility.

“Hospitals are pretty active every year, but they’ve definitely stepped it up this year,” said Smith, the Florida state senator. “I’ve seen more hospital administrators and board members walking the halls than ever. And they’re not just talking to health committee members but to everyone.”

But hospital lobbyists are finding that many Republican legislators who oppose Medicaid expansion—and the health care law as a whole—on ideological grounds aren’t convinced by economic and public health arguments.

“They are very passionate about why they were elected,” said Jonathan Archey of the Ohio Hospital Association. “They have an ideological frustration or opposition to Medicaid in general and with the president’s health plan in particular. That makes them mistrustful. They don’t expect Congress will maintain that high level of funding. They doubt Congress will allow the states to continue to pay 10 percent and they think 10 percent is too high already.”

Even if the logic of the expansion made sense to them, Dorn said, many of those conservative Republican legislators worry that a “yes” vote would make them vulnerable to a primary challenge from the right when they run for re-election.

Their allies give the hospitals credit for their leadership role in the state campaigns. But Cathy Levine, with Universal Health Care Action Network of Ohio, warns that the hospitals will have to do even more if they are going to succeed, at least in Ohio.

“As much as the hospital association has done in reaching out to members, if this is going to happen in Ohio, given the political dysfunction in the face of overwhelming public support for Medicaid expansion in the state, the hospital association is going to have to step up even more,” Levine said. “The ones that get listened to the most in this state are the ones with the deeper pockets. And the hospitals have very deep pockets.”