"We're not buying credits that look good for one or two years, but for 10 to 20 years," Metzold said.

"Dirt Bonds"

Municipal junk bond funds also have been helped by the recovering housing market, which has lifted the value of land-backed development bonds, said John Miller, co-head of fixed income at Nuveen Asset Management LLC. The so-called dirt bonds got crushed during the housing crisis and remain a core holding for many municipal junk bond fund managers.

In addition, muni bond managers of all stripes are taking advantage of ultra low short-term interest rates to borrow money to buy long-term bonds. Because the yields on the long-term bonds are higher than they pay in interest to finance the transaction, the funds can take advantage of the difference, generating extra income for their investors. The borrowing rate is reset weekly off the Securities Industry and Financial Market Association Municipal Swap Index. SIFMA's variable rate is currently 0.08 percent.

"It's been one of the best markets ever for this strategy," Miller said. He said Federal Reserve Chairman Janet Yellen's recent comments indicating that rates will stay low for some time to come should mean that the strategy has staying power.

The performance of junk bonds may be getting noticed. After pulling $10 billion from municipal junk bond funds last year, investors have piled back in with year-to-date net deposits of $4.3 billion, according to Lipper, a unit of Thomson Reuters.

Rock-Bottom Lows

Funds run by OppenheimerFunds, part of insurer MassMutual Financial Group, were among last year's worst performers because of their heavy bets on Puerto Rico. But those funds have recovered this year as Puerto Rico bonds have rallied from rock-bottom lows. The S&P Municipal Bond Puerto Rico Index, which measures the performance of bonds issued by the Caribbean island, is up 9.53 percent this year.

The $127 million Oppenheimer Rochester Virginia Municipal Fund is the No. 1 performing municipal bond fund tracked by Lipper, posting a year-to-date return of 12.85 percent, after losing nearly 16 percent in 2013. The fund's largest holdings include Puerto Rico debt and junk-rated tobacco bonds.

Meanwhile, the worst performing municipal bond funds in 2014 don't have credit risk problems. They're mostly conservatively run funds that offer investors more yield than a money market fund, but have been hurt by Federal Reserve policy that has kept short-term interest rates at historically low levels.