Gutsy contrarian investors seeking bargains may want to consider stepping up to buy unloved ETFs tracking emerging markets.

ETFs following developing markets and the so-called BRIC nations are lagging the S&P 500 by a wide margin this year. Also, investors have poured nearly $95 billion into U.S. stock ETFs in 2013, while pulling more than $8.4 billion from emerging market ETFs, according to Bloomberg.

In fact, money is flowing from developing market ETFs and moving into U.S. stock funds at the fastest rate ever, according to the report.

“The weakness in emerging markets and the associated economic troubles have encouraged some investors to reallocate from the emerging world to the U.S.,” said James Gaul, a fund manager at Boston Advisors LLC, in the article. “The U.S. is seen as the most stable economy at the moment, and the equity market is viewed as having better prospects than the rest of the world.”

However, the outflows and underperformance mean emerging market ETFs could be undervalued. The S&P 500 is trading at 16 times earnings, or 70% more than the MSCI Emerging Markets Index – developing market equity valuations are at a four-year low, according to Bloomberg.

The BRIC countries are Brazil, Russia, India and China. [Russia ETFs Struggle with Higher Rates]

Funds in this category include iShares MSCI BRIC Index Fund (NYSEArca: BKF), Guggenhiem BRIC ETF (NYSEArca: EEB) and SPDR S&P BRIC ETF (NYSEArca: BIK). [India ETFs Fall as Rupee Hits Fresh Low]

The ETFs are down more than 8% so far this year, while SPDR S&P 500 (NYSEArca: SPY) is up nearly 18%. [BRIC, Emerging ETFs Need Brazil to Get Back in the Game]

In diversified emerging market ETFs, investors have pulled cash from the category in five of the last six months, and annual outflows are on pace for their largest total since at least 2000, according to Bloomberg. Vanguard FTSE Emerging Markets (NYSEArca: VWO) and iShares MSCI Emerging Markets (NYSEArca: EEM) are among the largest ETFs in this group.

“Investors are going to go where they’re treated best and right now the U.S. stands out,” said Bruce Bittles, chief investment strategist at RW Baird & Co., in the story. “A lot of bearish sentiment is building in emerging markets. Eventually once it reaches extreme, which I don’t think it has yet, it will provide a strong base for the markets to rally from.”

The chart below shows the relative performance of a BRIC ETF versus the S&P 500. The BRIC fund has been leading since early July.

Full disclosure: Tom Lydon’s clients own EEM and SPY.