Hospitals that treat many poor and uninsured patients were expected to face tough financial times in states that did not expand Medicaid under the Affordable Care Act.

That’s because they would get less Medicare and Medicaid funding under the health-care law, while still having to provide high levels of charity care.

But in some of the largest states that did not expand Medicaid, many “safety net” hospitals fared pretty well last year — better than in 2013 in many cases, according to their financial documents. Kaiser Health News looked at the performance of about a dozen such hospitals in Florida, Texas, Georgia, Tennessee, South Carolina, Virginia and Kansas, which released their 2014 financial results.

An improving economy was the biggest reason shared by all of the strongly performing hospitals, because it helped reduce the number of patients who could not pay their bills and increased local property and sales tax revenue earmarked for publicly supported hospitals.

Another factor for some hospitals was the increase in insured patients who bought coverage through the health law’s insurance exchanges. For instance, Fort Lauderdale, Fla.-based Broward Health experienced a 30 percent drop in charity care, which officials attributed to seeing more insured patients.

Still, the biggest fiscal challenges lie ahead — with significant Medicaid funding cuts starting late next year under the Affordable Care Act. The drafters of the health law, which faces another challenge before the Supreme Court this week, anticipated the number of uninsured Americans to decrease dramatically, in part because they expected a nationwide expansion of Medicaid. Therefore, beginning in October 2016, the law calls for cuts to a special pot of Medicaid funding for hospitals that typically see a disproportionate share of the poor. In addition, other special Medicaid funding that supports indigent care in certain states (and that predates the 2010 health law) is slated to expire in Florida in June and in Texas next year.

“We are still very early in the Affordable Care Act, and one year does not make a trend,” said Daniel Steingart, an analyst with Moody’s Investors Service. “Just because they got though this period does not mean they do not have more financial pain to come.”

Safety-net hospitals, many of which are supported by local or county taxpayers, often struggle financially because they see a high proportion of patients who are uninsured or enrolled in Medicaid, the state-federal program that pays less money than Medicare and private insurers. The hospitals face added pressure from providing high-cost and traditionally money-losing services such as trauma and burn care. They also have the expense of training doctors.

Nonprofit hospitals need to make enough money to buy new equipment, expand services and meet rising labor costs. The average nonprofit hospital makes about a 3 percent profit margin, Steingart said.

In the past decade, two of the nation’s largest public safety-net hospitals — Grady Memorial Hospital in Atlanta and Jackson Health System in Miami — were on the verge of financial collapse but recovered after major management changes and increased public support.

Last year, the county-owned Jackson finished its second consecutive year with about a $51 million surplus on about $1 billion in revenue, in part as a result of increased county sales-tax revenue going to the health system and tighter expense management.

Grady’s profit increased to nearly $30 million through November, up from $17 million for the same period in 2013.

Several other safety-net facilities in states that did not expand Medicaid had profits in 2014, according to financial reports:

● Broward Health, which runs four hospitals, recorded $69 million in profit in the fiscal year ended June 30, compared with $59 million a year earlier, on about $1 billion in revenue. That included support from local taxpayers.

● Orlando Health, a six-hospital system in central Florida, saw its profit grow to $161 million in the fiscal year ended in September, up from $32 million the year before, on about $2 billion in revenue. Its vice president of finance, Paul Goldstein, cited the improving economy, an increase in the number of privately insured patients because of the health law and the financial performance of recently purchased doctors groups.

●Tampa General posted a $49 million profit last year, up from $31 million the year before, on $1 billion in operating revenue. Its operating margin was 4.5 percent.

●Chattanooga, Tenn.-based Erlanger Health System posted a $20 million profit for the six months ended Dec. 31, on revenue of $336 million, after factoring in local tax support, compared with a loss of $1.5 million in the same period a year earlier.

● Greenville Health System in South Carolina made a $63 million profit in the fiscal year ended Sept. 30, down slightly from $80 million the prior year. The system had about $1.8 billion in revenue.

Twenty-eight states have expanded Medicaid under the health law since the Supreme Court ruled the provision optional in 2012. Medicaid enrollment has increased nationally by almost 11 million since October 2013. Most of the drop in uninsured nationally is attributed to people gaining Medicaid coverage.

Not all safety nets did well last year. County-run Harris Health System in Houston is facing a $14 million budget shortfall and recently announced plans to lay off 108 workers. Officials blame Texas’s decision not to expand Medicaid and decreased payments from other federal programs. Nearly two-thirds of Harris’s patients are uninsured — a far higher percentage than at most safety-net hospitals.

Parkland Health and Hospital System, which is supported by Dallas County property taxes, finished in the black but saw its profits decline from $43.4 million in 2013 to $1.4 million in 2014.

Kaiser Health News is an editorially independent program of the Kaiser Family Foundation.