The longest-term municipal bonds offer a buying opportunity, analysts at JPMorgan Chase & Co. and Citigroup Inc. say, as yields reach a two-year high following Detroit’s bankruptcy and concern over the Federal Reserve curbing bond purchases.

Benchmark munis due in 30 years yield 4.64 percent, or about 1.8 percentage points more than 10-year borrowings, data compiled by Bloomberg show. That’s the widest gap since January 2012 and compares with an average of 1.14 percentage points since 2001. While 30-year muni yields jumped 1.67 percentage points since the start of May, similar-maturity U.S. Treasury rates increased 0.87 percentage point, the data show.

The interest-rate move has been fueled by investors pulling about $15 billion from long-term muni mutual funds for 23 weeks, the lengthiest stretch in two years, Lipper US Fund Flows data show. Taxable-equivalent yields on top-rated bonds are higher than those on BBB corporate debt, a signal for investors such as hedge funds, pensions and insurance companies to buy local- government bonds, according to Peter DeGroot, a municipal strategist at JPMorgan in New York.

“The whole long-end of the muni market is exceptionally cheap right now,” said Clark Wagner, who oversees $1.5 billion of munis as director of fixed income at First Investors Management Co. in New York. “Long munis look really attractive on a relative basis to corporates and to Treasuries.”

Fed Slowing

The longest-maturing bonds in the $3.7 trillion muni-debt market have outpaced a broad fixed-income decline spurred by concerns that the Federal Reserve will slow its bond-buying amid signs the U.S. economy is improving. Investors are betting that the end of the central bank purchasing $85 billion in Treasuries and mortgages each month will lead to higher interest rates.

In that scenario, investors holding bonds with longer maturities will miss out on a chance to lock in higher-yielding debt, while those with shorter-dated securities get cash back quicker to redeploy.

Detroit’s Chapter 9 filing on July 18 has produced bigger losses for munis relative to other assets. The bankruptcy cost the local-debt market about $13.8 billion through Aug. 7, according to J.R. Rieger, vice president for fixed-income indexes at Standard & Poor’s in New York.

The 23 straight weeks of investor withdrawals from long- term muni mutual funds is the longest since June 2011, when individuals pulled their money out for 31 weeks.

Whitney Prediction

That wave of outflows was spurred in part by banking analyst Meredith Whitney incorrectly predicting “hundreds of billions of dollars” of municipal defaults in the 12 months after her December 2010 interview on CBS Corp.’s “60 Minutes.”

The latest streak of withdrawals has been propelled by Detroit filing for the biggest U.S. municipal bankruptcy, said George Friedlander, chief muni strategist at New York-based Citigroup. The yield on benchmark 30-year munis has jumped 0.29 percentage point since the filing and is at the highest level since May 4, 2011, Bloomberg data show.

The taxable-equivalent yield on the AAA munis for the highest earners is about 7.68 percent, more than the 5.43 percent interest rate on BBB corporate securities with a similar maturity.

“The long end has gotten so cheap that we don’t have a problem putting some cash there,” Friedlander said. “We think that the market can rally somewhat from here because we’re going to have much lighter supply the rest of the year.”

Forecast Cut

Citigroup this month reduced its muni issuance projection for the year by 8.6 percent, to $320 billion, because rising yields may deter borrowing. States and localities have sold $200 billion so far this year, down from $224 billion over the same period in 2012, Bloomberg data show.

Longer-maturing munis appear cheap relative to other fixed- income assets and compared with their historical average, John Dillon at Morgan Stanley Wealth Management wrote last week. Yet investors should avoid them in anticipation of “a protracted and uneven ascent toward higher rates,” he said.

“Whether yields rise mildly or wildly, it’s clear that investors are now quite concerned over interest rate risk,” Dillon wrote. He recommended individuals buy debt maturing in five to 11 years.

Other investors are choosing to side with history. The 1.8 percentage points of extra yield from buying benchmark 30-year munis instead of those due in a decade is just 0.09 percentage point away from a record, Bloomberg data show.

Within three months of reaching that peak, the additional yield pickup dropped 40 percent, to 1.13 percentage points.

Gyrating Ratio

The ratio of 30-year AAA muni yields to those on comparable U.S. Treasuries is also near the highest in a year. About three months after touching its 2012 high of 127 percent, it fell to 97 percent, the lowest in almost two years, showing the relationship’s transient nature.

Issuers such as Chicago Park District are set to sell debt today, joining municipalities nationwide in offering $4.8 billion in long-term obligations this week, Bloomberg data show.

In the 10-year portion of the market, benchmark munis are yielding 2.88 percent. The interest rate compares with 2.71 percent for similar-maturity Treasuries. The ratio of the two yields is about 106 percent, compared with an average of 93 percent since 2001.

Following is a pending sale:

University of Washington in Seattle, with almost 51,600 students, plans to issue about $143.4 million in federally tax- exempt debt next week, partly to finance renovations of the football team’s Husky Stadium and to build a new baseball park. The bonds are rated AA+ by Standard & Poor’s and mature annually on July 1 through 2041. A unit of JPMorgan Chase & Co. is leading the sale.