State and local governments are going into 2014 with a brighter outlook than they’ve had in years, according to a pair of credit rating agencies, though they disagree on the situation for local governments.

Generally, states are in their strongest position “in years,” Fitch Ratings said in a statement on its 2014 outlook. That’s thanks to 14 straight quarters of revenue growth and strong fiscal 2013 revenues — spurred by taxpayers shifting income and deductions to 2012 to avoid the tax hikes that came out of the “fiscal cliff.” Most are seeing economic recoveries and are taking care to reconstitute financial cushions, though the outlook for some is still not quite as strong, according to Fitch.

And one threat looms large: the federal government. It represents “the most significant threat to state budgets,” Fitch said in its statement. Federal action — or inaction — can hurt the economy and that hurts states. Pensions are another threat. And expect the 36 state gubernatorial elections to influence the political focus of state governments.

Fitch isn’t as optimistic when it comes to local governments, but Moody’s, another ratings agency, sees a rebound afoot. For the first time in five years, its annual outlook for the year ahead will be stable, not negative.

“The ‘new stable’ will be an era of constrained resources, but the worst is over for local governments in most of the country,” Naomi Richman, a Moody’s managing director, said in the agency’s report.

The housing recovery, while expected to be slow, over the next two years will help local governments collect more revenue. But not every local government enters the year on equally steady ground. Local governments in 12 states — California, Florida, Illinois, Indiana, Kentucky, Michigan, Nevada, New Hampshire, New Jersey, New York, Pennsylvania, Rhode Island — will still face economic pressure.

Fitch, however, disagreed with Moody’s sunny outlook, upholding its negative outlook in a separate statement on local governments. “Even with financial market recovery, benefit spending growth will continue to put pressure on budgets in 2014,” Fitch said in its statement.