Wild swings in the stock market this week rattled investors, who pulled $3.5 billion from U.S. equity funds and fled to the safety of government debt.

Funds that invest in U.S. stocks saw the outflows for the week ending Wednesday, the largest exodus since the week ending Oct. 17, when $14.8 billion was withdrawn amid a deep equity sell-off, according to data from EPFR Global.

Stocks turned sour on fears of an economic downturn signaled by the bond market and ongoing U.S. trade tensions with China. They deepened on Tuesday, after President Donald Trump declared himself "a Tariff Man." U.S. talks with China on trade were further complicated by the arrest announced Wednesday of a top executive of Chinese tech firm Huawei apparently in connection with alleged violations of U.S. sanctions against Iran.