Stocks closed at their highs for the day after bouncing around throughout the session.
Stocks started the day in positive territory, helped by a pullback in oil prices, but then fell when oil reversed course and rose to about $131 a barrel.
The market then bounced around between positive and negative territory for most of the day, rallying in the final hour to close higher. Stocks were helped by a stronger dollar and a better-than-expected showing by April durable goods orders.
American International Group , the world's largest insurer, fell sharply after Citigroup said the insurer may need even more capital after raising $20 billion just last week.
Deepening concerns about the banking sector, KeyCorp said mounting loan losses could cause write-offs to double from its prior forecast, sending its shares more than 11 percent lower.
The retail sector gained after Polo Ralph Lauren reported sharply higher quarterly profit that soared past Wall Street estimates, sending the clothing maker's shares up 11 percent to $68.46.
"You have a tug of war going on between the good news and the bad news," said Jim Awad, chairman of W.D. Stewart. "The good news (is) business spending and Ralph Lauren profits, and the bad news is the financials downgrades and Key Corp."
"The swing factor that will referee this and push (the market) one way or another will be oil and gold," he added.
Underscoring concerns about the outlook for financial stocks, J.P. Morgan Securities cut its profit view on three large U.S. investment banks and suggested investors avoid the brokerage sector as earnings estimates continue to appear too bullish.
Gold bounced off a two-week low as oil reversed its losses, highlighting the metal's appeal as a hedge against inflation.
Spot gold was trading at $900.50 an ounce, up from an earlier low of $889.35 but down from Tuesday's $907.10.
The news on KeyCorp, a large Midwest bank, rattled other regional banks.
Ohio-based Fifth Third , fell 3.41 percent to $18.87 and Texas-based Comerica fell 4.8 percent to $35.31.
"The KeyCorp news last night showed we are not out of the woods yet in financials," said Kurt Brunner, portfolio manager at Swarthmore Group in Philadelphia, Pennsylvania.
Low-fare carrier JetBlue Airways fell 4.2 percent to $4.23, after the company said it was deferring delivery of 21 Airbus A320 aircraft for up to five years because of current high fuel costs.
United Parcel Service shares rose 3 percent after it announced a proposed 10-year contract with DHL Express in the United States and Merrill Lynch recommended investors buy the company's shares.