The Affordable Care Act, President Obama pledged, would stem the rapidly rising cost of health care. Early indications suggest it has: The growth of total U.S. health-care spending ebbed in 2012 to just 4 percent.

But for state and local governments, bending the cost curve hasn’t happened. In fact, a new report from the Pew Charitable Trusts shows health-care spending is consuming a greater percentage of state and local government budgets than at any time since the Centers for Medicare and Medicaid Services began collecting data.

State and local governments spent 31.5 percent of their budgets on health-care costs in 2012, according to CMS and the Bureau of Economic Analysis. That marks an 8 percent increase over the previous year, twice the national rate of increase.

The jump in spending is due in part to the stimulus bill passed by Congress at the depths of the recession in 2009. The American Recovery and Reinvestment Act extended grants totaling more than $100 billion to states to cover Medicaid costs, which ballooned as the spike in unemployment drove more job-seekers to the government-run health program.

Despite the increasing numbers of Medicaid enrollees, state spending on Medicaid actually fell between 2008 and 2010.

But when the federal stimulus money dried up, states were still on the hook. State Medicaid expenditures spiked 22 percent between 2010 and 2011, and another 15 percent in 2012.

Over the long term, state and local spending on public employee health insurance and Medicaid have accounted for the largest increases in government spending. Between 1987, when CMS began keeping the data, and 2012, spending on public employee insurance plans grew by 444 percent, while Medicaid spending grew 375 percent, to $188.8 billion.

The Government Accountability Office says health-care spending represents the single greatest threat to state and local government long-term fiscal health. In 2014, the GAO expects local government spending on health care to stand at 4.1 percent of the country’s gross domestic product; by 2060, that number is expected to jump to 7.2 percent.

In a separate GAO report, the agency found money earmarked for health care is becoming an increasingly large portion of the grants the federal government sends to states. In 1980, money for health-care spending made up 24 percent of federal grants to states; by 2010, that number had more than doubled, to 58 percent.

Health care spending made up 13 percent of state and local government expenditures in 1980. Thirty years later, that number was 22 percent.