The biggest rally in U.S. state bonds in two years shows investors are betting the governments will weather the federal shutdown and any failure by lawmakers to raise the nation's debt ceiling.

October 2, 2013(c) 2013, Bloomberg News.

NEW YORK - The biggest rally in U.S. state bonds in two years shows investors are betting the governments will weather the federal shutdown and any failure by lawmakers to raise the nation's debt ceiling.

Yields on state general obligations are about 1 percentage point under the average for the $3.7 trillion municipal market, close to the widest advantage since August 2011, Bank of America Merrill Lynch data show.

Investors are speculating that 15 straight quarters of rising tax revenue will cushion states against the federal spending impasse and possible cutbacks as the U.S. approaches a deadline of about Oct. 17 to raise the $16.7 trillion debt limit.

"At the state level, revenues are coming in stronger than what budgets anticipated," said Linda Murphy, a muni analyst in Baltimore at T. Rowe Price Group Inc., which oversees $20 billion in local debt. "If we have a little bit of a backup because of a federal shutdown, I'm not really concerned."

Forty states rely on federal revenue for at least 31 percent of total government funds, according to Moody's Investors Service. Yet the rally shows confidence in the governments after they cut costs and curbed spending to balance budgets following the 18-month recession that ended in 2009.

States trimmed payrolls to the lowest since 2004, slowed borrowing for new projects and collected 9.4 percent more tax revenue in the second quarter versus a year earlier, data from Moody's, the Labor Department and the Census Bureau show.

The federal government's first partial shutdown since 1995 began with the fiscal year starting Tuesday. Legislation to fund the government stalled as congressional Republicans stuck with demands for changes in President Barack Obama's 2010 Affordable Care Act. Obama and congressional Democrats refused to go along.

The stalemate may cost the U.S. at least $300 million a day in lost economic output, according to research firm IHS. While that's a fraction of the country's $15.7 trillion economy, the effects probably will grow as consumers and businesses defer spending.

Even if the budget standoff is resolved, lawmakers would face the next fiscal dispute over raising the debt ceiling. Failure to do so would lead to a first-ever default, subjecting all federal spending to possible cuts.

States such as Louisiana, Idaho and Arizona, which rely on federal dollars for at least 41 percent of total funds, may compensate by transferring less money to localities and health- care providers, Moody's said. Munis backed by federal mass- transit aid are most vulnerable, the company said.

Dependence on federal spending doesn't guarantee fiscal strength. Idaho had the strongest economy of any state in the 12 months through June, while Louisiana's was fifth-worst, according to the Bloomberg Economic Evaluation of States index. The health of 44 states improved in the period.

Federal cuts could extend declines in state payrolls. The number of people employed at the state level fell to 5.01 million in August, the least since December 2004, Labor Department data show.

"In the case of spending, states for the most part have had to get their houses in order sooner because of their requirement for balanced budgets," said Gregg Bienstock, chief executive officer of Stamford, Conn.-based Lumesis Inc., which compiles economic and demographic data.

Many federal employees reporting to work Tuesday were given time to prepare for the shutdown before being sent home until Congress passes a spending measure. National parks and museums were shuttered.

On top of the blow from furloughed workers, states will also suffer from lost federal-grant money, said Scott Pattison, executive director of the National Association of State Budget Officers in Washington.

"It's one of those things that you can muddle through without a lot of problems for a very short period of time," Pattison said in an interview. A shutdown extending beyond this week "becomes more and more serious," he said.

Oklahoma Gov. Mary Fallin, R, and Colorado Gov. John Hickenlooper, D, co-signed a National Governors Association letter to Obama and congressional leaders that called the potential effect of not increasing the debt limit "severe" for state economies.

"Over the past several years governors have made tough choices to balance our state budgets and do more with less," the governors said in the letter. "A lack of certainty at the federal level from a shutdown therefore translates directly into uncertainty and instability at the state level."

The events this month highlight how state and local general-obligation bonds have become more sensitive to the economy, said Michael Zezas, chief municipal strategist at Morgan Stanley in New York. He rates the two segments as the least attractive among nine areas in a Sept. 25 report.

"Most of the repair states have done is based on strong revenue growth as opposed to other structural fixes, and that revenue growth is largely based on a cyclical rebound in the economy," Zezas said in an interview. "If you take that growth away, you stunt the pace of repair."

General-obligation bonds are backed by the full faith and credit of states and cities, which can raise money through taxes. No state has defaulted on debt since Arkansas during the Great Depression.

"Within general-obligation bonds, we have a preference for states over locals - the powers states have are so much stronger," T. Rowe's Murphy said. "My general feeling is this is going to be a little painful at the margin, but more of a passing thing."

In the municipal market this week, localities from South Carolina to California are selling $3.6 billion in long-term debt with yields near the lowest since June.

Top-rated 10-year munis yield 2.72 percent, Bloomberg data show. The interest rate compares with 2.65 percent for similar- maturity Treasuries.

The ratio of the yields, a gauge of relative value, is about 103 percent, compared with an average of 93 percent since 2001. The higher the figure, the cheaper munis are compared with federal securities.

_ With assistance from Mark Niquette in Columbus and Ted Bunker in Boston.