The Dow and the S&P 500 edged higher on Monday, recovering from a fall at the open, as a weaker dollar helped commodity-related stocks snap back from a selloff in the last session.

An inverse correlation between the dollar and stocks has started to reemerge as volatility in markets increases before the Federal Reserve is expected to end its stimulus program next month.

The S&P's materials sector <.GSPM> gained 1.4 percent and was the best performing sector, helped by gains in Cliffs Natural Resources , up 5.1 percent to $88.67 after Citigroup lifted it price target on the stock to $122.

Cliffs produces iron ore pellets and metallurgical coal.

People felt the early morning pessimism was not warranted and then stepped in as a buying opportunity, said Peter Jankovskis, co-chief investment officer at OakBrook Investments LLC in Lisle, Illinois.

The Dow Jones industrial average <.DJI> gained 37.35 points, or 0.30 percent, to 12,633.10. The Standard & Poor's 500 Index <.SPX> gained 3.80 points, or 0.28 percent, to 1,341.57. The Nasdaq Composite Index <.IXIC> dropped 5.97 points, or 0.21 percent, to 2,822.50.

In deal news, shares of NYSE Euronext fell 10.4 percent to $36.66 after Nasdaq OMX Group Inc and IntercontinentalExchange withdrew their bid for the rival exchange.

Meeting on Monday, euro zone finance ministers are likely to back a bailout package for Portugal, with new conditions set by Finland. During the meeting euro zone officials were expected to pressure Greece to announce more austerity steps to secure further emergency funding.

International Monetary Fund Managing Director Dominique Strauss-Kahn entered a New York court for arraignment after a weekend arrest on charges of attempted rape of a hotel maid. The case sent shock waves through French political circles and left the IMF in turmoil.

In earnings news, shares of J.C. Penney Co Inc rose 0.4 percent to $38.26 after the company reported a higher quarterly profit but later the stock eased 0.5 percent to $38.24.

But Lowe's Cos reported weaker-than-expected quarterly results and cut its forecast for the year, sending shares down 2 percent to $25.25.

UBS increased its earnings view for S&P 500 companies for this year and next after stronger-than-expected earnings in the first quarter but said it was maintaining its 1,425 target level for the index as indicators signal a soft patch for markets.

A gauge of manufacturing in New York State tumbled much more than expected in May to its lowest level in five months, the New York Federal Reserve said in a report, souring investor sentiment as markets worry about a slowdown in the economy.

(Reporting by Edward Krudy, Editing by Kenneth Barry)