* U.S. agrees to refrain from car tariffs on EU for now (Updates to U.S. market open; changes dateline, previous LONDON)

By Trevor Hunnicutt

NEW YORK, July 26 (Reuters) - World stock markets struggled to hold on to four-month highs as a massive selloff in shares of Facebook Inc offset optimism that the European Union and the United States would settle their differences on trade.

Facebook, the fifth-largest U.S. stock by market capitalization, collapsed 19.35 percent after the social media company after earnings showed slowing usage in the biggest advertising markets. Executives warned profits would plummet as the company improves privacy safeguards.

That countered optimism over news that U.S. President Donald Trump agreed to refrain from imposing car tariffs while Europe and the U.S. negotiated to cut other trade barriers.

MSCI's gauge of stocks across the globe gained just 0.05 percent after earlier rising to its highest since March 16.

On Wall Street, the Dow Jones Industrial Average rose 136.92 points, or 0.54 percent, to 25,551.02, the S&P 500 lost 5.15 points, or 0.18 percent, to 2,840.92 and the Nasdaq Composite dropped 64.68 points, or 0.82 percent, to 7,867.56.

"It's going to be hard for markets today with such a massive market cap stock down so much," said Michael Antonelli, managing director, institutional sales trading at Robert W. Baird & Co. "It is possible that easing tensions could outweigh something like Facebook, because that has been the biggest concern of markets for weeks and Facebook is a one-off negative event."

Concerns about Facebook's major earnings miss in an otherwise largely positive U.S. corporate results season did little to support bonds, which lost value as yields resumed their climb higher.

Benchmark U.S. 10-year notes last fell 5/32 in price to yield 2.9542 percent, from 2.936 percent late on Wednesday.

Trade is by no means removed from a slate of issues facing investors, with the U.S. still to finalise an agreement with Europe, while it remains in negotiations with China as well as with Canada and Mexico.

The breakdown of the deal leaves "investors fearing that the trade war has just turned even more so on China," Citi analysts told clients.

Still, the heat has eased somewhat, over U.S. and European trade issues.

"The lifting of the threat of tariffs on the auto sector in particular is a major development. We've not seen a lot of actual measures implemented but it should lift the confidence of manufacturers," said Royal Bank of Canada European economist Cathal Kennedy.

That allowed markets to return their attention to central banks and their plans to withdraw stimulus.

The euro, which initially received the U.S.-EU trade news warmly, sharply lost ground after European Central Bank boss Mario Draghi reaffirmed a commitment to keep interest rates on hold "through" next summer, even though he saw inflation picking up by the end of the year.

The dollar index rose 0.31 percent, with the euro down 0.62 percent to $1.1655.

Reporting by Trevor Hunnicutt
Additional reporting by Amy Caren Daniel in Bengaluru, Andrew
Galbraith in Shanghai, Abhinav Ramnarayan and Tommy Wilkes in
London