ETFs tracking U.S. mid-cap stocks and European markets were the hottest funds in August based on buying patterns.

For example, iShares Core S&P Mid-Cap (NYSEArca: IJH) was the best-selling ETF last month with inflows of $2.2 billion, according to IndexUniverse data. A leveraged fund, ProShares Ultra MidCap 400 (NYSEArca: MVV), reeled in over $1.3 billion.

ETF investors also seem to be betting on a recovery in Europe, which is trying to put its debt woes behind it. Vanguard FTSE Europe (NYSEArca: VGK) attracted $1.6 billion last month while iShares MSCI EMU (NYSEArca: EZU) hauled in $974 million. EZU tracks countries in the European Monetary Union.

Pan-European equity ETFs hit an all-time high of $4.7 billion in inflows in August, driven by the improving macroeconomy for the Continent and individual countries, said Todd Rosenbluth, director of ETF research at S&P Capital IQ.

Meanwhile, mid-cap ETFs brought in over $3 billion globally.

Headlines this week have focused on the record outflows in ETFs in August, with U.S. stock ETFs shedding over $14 billion. However, Rosenbluth points out that all but $500 million of this was tied to one fund, SPDR S&P 500 (NYSEArca: SPY).

“Despite the outflows across the broader asset categories in August, we think investors will bring fresh money back in throughout the year. The appeal of ETFs remains high, in our opinion, as investors have thousands of ways to get exposure to the equity, fixed income and commodity markets at a relatively low cost and with greater transparency than they can through mutual funds,” Rosenbluth said in a note.

“S&P Capital IQ believes that while the U.S. equity markets should trade sideways in September, there is room for further upside.  We also see further growth ahead for Europe, with improving economic data. Lastly, while investors will likely remain concerned about interest rates, we think there are a number of good short-term focused fixed income offerings,” he added.

Full disclosure: Tom Lydon’s clients own SPY.