After the Detroit’s bankruptcy hindered demand, municipal bonds, along with related exchange traded funds, are posting robust gains on huge inflows.

Year-to-date, the iShares S&P National AMT-Free Muni Bond ETF (NYSEArca: MUB) is up 6.3%, SPDR Nuveen Barclays Municipal Bond ETF (NYSEArca: TFI) rose 6.4% and Market Vectors Intermediate Municipal Index ETF (NYSEArca: ITM) increased 7.1%.

According to Lipper data, muni funds have gathered $3.1 billion in assets this year, a stark shift after the $39.9 billion pulled from muni funds over the last 31 weeks of 2013, reports Aaron Kuriloff for the Wall Street Journal.

Meanwhile, yields on muni debt dipped to 2.325% Wednesday, its lowest in almost a year. MUB has a 1.85% 30-day SEC yield, TFI has a 2.06% 30-day SEC yield and ITM has a 2.17% 30-day SEC yield.

Municipal bonds have been one of the best performing assets this year. Munis returned 5.869% in 2014, including interest payments and price appreciation, compared to the 5.769% return on investment-grade corporate debt, 3.3% for the S&P 500 and 2.982% on Treasuries.

High-yield municipal bonds have jumped 9.332% year-to-date, according to Barclays data. The Market Vectors High Yield Municipal Index ETF (NYSEArca: HYD), which has a 5.08% 30-day SEC yield, is up 10.1% year-to-date, and the SPDR Nuveen S&P High Yield Municipal Bond ETF (NYSEArca: HYMB), which has a 4.56% 30-day SEC yield, is up 12.5%. [It May Be Time to Scale Back on High-Yield Muni ETFs]