People wait to cross a street as cars pass by in Tokyo
People, standing in front of an electronic board displaying share prices, wait to cross a street as cars pass by in Tokyo August 22, 2011. The Nikkei stock average marked its lowest close since March 15 on Monday as worries about the U.S. economy offset signs that the Japanese authorities stand ready to quell any further yen strength. Picture taken using slow shutter speed. Reuters

World stocks eked out a gain on Monday, stabilizing after the previous four weeks of sharp losses, while Brent crude prices slipped on prospects Libya's civil war will soon end.

U.S. stocks struggled to end barely higher, while gold, a traditional safe haven, hit a third consecutive all-time high near $1,900 after staging its biggest weekly gain in 2-1/2 years last week.

Sharp volatility in stocks, which has marked trading in recent weeks, underscored investor nervousness.

The turmoil largely reflects persistent worries that the United States may fall back into recession, as well as the threat that sovereign debt problems in euro zone peripheral countries could spread to the larger economies.

The cost for euro zone banks to borrow money from one another rose again, heading back toward their highest levels since late 2008 as U.S. banks remained wary of lending to European counterparts in the face of the intractable debt crisis.

The ground zero of all worries is financials, said Charlie Smith, chief investment officer at Pittsburgh-based Fort Pitt Capital Group.

Bank stocks, seen as most vulnerable to the debt crisis in Europe, underperformed other sectors. JPMorgan Chase (JPM.N) fell 2.7 percent to $33.41 and was the top drag on the Dow, followed by Bank of America (BAC.N), down 7.9 percent at $6.42.

Speculation is widespread in financial markets that Federal Reserve Chairman Ben Bernanke will use his Friday speech at a central banker conference in Jackson Hole, Wyoming, to signal a new monetary offensive to support the faltering U.S. economy.

That helped support stocks and gold but weigh on U.S. bond prices.

Bernanke, however, is most likely to outline gradualist measures, which would disappoint those looking for a big-bang approach such as a fresh round of bond buying, known as QE3.

The Fed chairman looks set to discuss ways the central bank could tweak the Fed's balance sheet as a means to put further pressure on medium and long-term interest rates and anchor them at low levels. These could be implemented in September and October at coming Fed meetings.

The Fed is definitely on people's minds, and you could argue that some of the bounce seen in high-yield commodity currencies is at least in part related to hopes for more policy measures, said Wells Fargo strategist Vassili Serebriakov in New York.

On Wall Street, the Dow Jones industrial average .DJI gained 37.00 points, or 0.34 percent, at 10,854.65. The Standard & Poor's 500 Index .SPX was up 0.29 point, or 0.03 percent, at 1,123.82. The Nasdaq Composite Index .IXIC added 3.54 points, or 0.15 percent, at 2,345.38.

The S&P, which on Friday posted a fourth week of losses, is down 16.4 percent since July 22, roughly when the recent sell-off began.

For the day, shares of large-cap technology companies outperformed most other shares, with IBM (IBM.N) leading gains on the Dow. IBM was up 0.9 percent at $158.98. Shares of Hewlett-Packard (HPQ.N) rose 3.6 percent to $24.45 after its sharp losses last week.

The MSCI Latin America stock index .MILA00000PUS slipped 0.34 percent, adding to four straight weeks of losses. An early morning surge in Brazilian stocks lost steam and Latin America's biggest stock market closed flat.

Mexico's IPC index .MXX gained 1.38 percent as shares of billionaire Carlos Slim's America Movil (AMXL.MX), one of the world's biggest telecoms, jumped 1.95 percent.

The FTSEurofirst 300 .FTEU3 index of top European shares rose 0.8 percent to close at 916.78.

The MSCI world equity index .MIWD00000PUS ended down 0.1 percent after fluctuating between negative and positive territory for much of the day. The index has fallen for five weeks in a row and appears headed for its worst monthly performance since October 2008, when markets were reeling after the collapse of Lehman Brothers.

In the oil market, Brent crude settled at $108.36, down 26 cents on the Libya news. But U.S. crude oil settled higher on the New York Mercantile Exchange. Crude for September delivery expired and settled at $84.12 a barrel, up $1.86, or 2.26 percent.

The Fed speculation also put some early pressure on the dollar against some commodity-linked currencies. The Australian dollar was last up 0.2 percent at $1.0414. The New Zealand dollar rose 1 percent to $0.8241 while the greenback slipped 0.1 percent to 0.9894 Canadian dollar.

The benchmark 10-year note fell 10/32 in price, yielding 2.10 percent versus Friday's close of 2.06 percent.

One of this year's best-performing assets, spot gold was up 1.6 percent at $1,889.29 an ounce, building on its strongest one-week rise since February 2009.

Gold is driven by the expectation that at some point inflation will come back, and a continuation of people looking for a safe haven beside just the U.S. Treasury bonds, said Leo Larkin, metals equity analyst at Standard & Poor's.