Mutual funds and ETFs suffered their biggest outflows in almost three years in June.

Long-term funds and ETFs experienced net outflows of $22 billion, the most since August 2015 with U.S. equity funds the biggest losers, according to Morningstar Direct’s latest asset flows report. They experienced net outflows of $20.8 billion in June, more than reversing the $20.7 billion in net inflows in May.

(Related: Maybe the Future of Fund Management Isn’t So Bleak)

International equity funds followed, losing a net $9.78 billion, their worst drawdown since 2008. Net flows also fell for allocation funds (-$4.87 billion), alternative funds (-$2.5 billion), commodities funds, (-$1.7 billion) and sector equity funds (-$565 million).

Only bond funds and ETFs — taxable and municipal — experienced inflows in June, led by ultrashort funds, which took in $5.5 billion, about one-third the $15.5 billion inflows in taxable bond inflows.

Active and Passive Funds See Outflows

Both active and passive U.S. equity funds saw withdrawals in June, which hasn’t happened since March, but withdrawals from active equity funds were roughly five times the size of withdrawals from passive funds: $17.1 billion compared with $3.7 billion.

(Related: Why Low-Cost Index Investing Is Not Necessarily Low Risk)

Paradoxically the biggest outflows came from a handful of equity index funds: the SPDR S&P 500 ETF (SPY), iShares Core S&P 500 ETF (IVV), Vanguard Institutional Index (VINIX), Invesco QQQ Trust (QQQ) and Vanguard Total Stock Market Index (VTSMX). Together these equity index funds accounted for $14.7 billion in outflows, or more than two-thirds of total outflows from equity funds in June.

“It’s hard to know how much of last month’s U.S. equity passive outflows reflect a change in investors sentiment versus simple trading or rebalancing,” according to the Morningstar report. “With the global population aging and many investors focused on capital preservation, equity demand among fundholders remains tepid.”

Passive funds overall had inflows of $3.4 billion, which is the lowest level since January 2014, according Morningstar analysts.

The low level of inflows into passive funds coupled with large outflows from passive U.S. and international equity funds hit BlackRock’s iShares and State Street Global Advisors’ SPDR ETFs the hardest. Together they saw $15.4 billion in net outflows, including $8.8 billion for iShares alone, its biggest level of outflows in five years.

Franklin Templeton, Invesco and T. Rowe Price also experienced outflows in June.