(Adds additional flows, comments, market performance)
NEW YORK, July 18 (Reuters) - Investors worldwide poured $6.2 billion into stock funds in the week ended July 16, encouraged by strong corporate earnings and big potential merger deals in the United States, data from a Bank of America Merrill Lynch Global Research report showed on Friday.
The net inflows were the biggest in four weeks and the inflows into funds that specialize in U.S. stocks were also the biggest in four weeks at $2.5 billion, according to the report, which also cited data from fund-tracker EPFR Global. Bond funds attracted $3.5 billion.
All of the inflows into stock funds went toward exchange-traded funds, which are believed to represent the behavior of institutional investors. European stock funds posted $300 million in outflows, marking their second straight week of withdrawals.
Second-quarter profits from major banks JPMorgan Chase and Goldman Sachs beat analysts' expectations over the period, while Twenty-First Century Fox's confirmation that it made an $80 billion takeover offer for Time Warner Inc also boosted sentiment for equities.
"The quantity of the deals is just unbelievable right now. It's an amazing environment," said Robert Francello, head trader at Apex Capital in San Francisco.
In addition, Federal Reserve Chair Janet Yellen said July 15 that the incomplete U.S. economic recovery warranted loose monetary policy for the foreseeable future, boosting sentiment toward U.S. stocks.
Emerging market stock funds attracted $1.1 billion, marking their sixth straight week of inflows.
While still positive on U.S. stocks, investors are also looking to emerging market stocks to diversify after a seven-year rally in U.S. equities, Francello said. He said outflows from European stock funds likely occurred partly on the threat of deflation in the region.
The inflows into bond funds marked their fourth straight week of new demand. Riskier high-yield bond funds posted $2.7 billion in outflows, marking their biggest outflows since August 2013, while safer investment-grade bond funds reaped $4.7 billion to mark their 30th straight week of inflows.
Emerging market bond funds attracted $900 million, marking their biggest inflows in six weeks. Funds that mainly hold safe-haven U.S. Treasuries attracted $900 million, marking their second straight week of inflows.
While high-yield bond funds are viewed by some as overvalued, Treasuries, investment-grade and emerging market bonds are attractive to investors on reduced concerns that the Fed will raise rates soon, said Michael Temple, portfolio manager at Pioneer Investments in Boston.
Commodities funds attracted $400 million, marking their fourth straight week of inflows. The inflows came after gold rebounded on July 16 following a two-day tumble.
(Reporting by Sam Forgione; Editing by Chizu Nomiyama and Lisa Shumaker)