Wall Street erased most gains on Wednesday after Spain's rating was downgraded as investors awaited Federal Reserve comments at the end of a two-day policy meeting.

Standard & Poor's cut its key rating on Spain by one notch, citing a more protracted period of sluggish growth than previously expected. Jitters over sovereign debt problems have hurt global equities and commodities.

U.S. bank shares rose, buoying the S&P 500, with JPMorgan & Co up 2 percent to $43.25, while the KBW bank index <.BKX> added 1.5 percent. Shares had rebounded earlier in the session after a steep sell-off on Tuesday, following debt downgrades to Greece and Portugal.

International Monetary Fund Managing Director Dominique Strauss-Kahn estimated a Greek aid package at 100 billion to 120 billion euros, according to German officials. The news partly eased concern over sovereign debt problems, but Spain's downgrade brought back worries of contagion.

The sovereign debt issues add discomfort, said Kurt Brunner, portfolio manager at Swarthmore Group in Philadelphia. It gives investors some pause, as it should, so it's an opportunity to sell.

The Dow Jones industrial average <.DJI> gained 31.66 points, or 0.29 percent, to 11,023.65. The Standard & Poor's 500 Index <.SPX> added 5.21 points, or 0.44 percent, to 1,188.92. The Nasdaq Composite Index <.IXIC> dropped 4.63 points, or 0.19 percent, to 2,466.84.

About four stocks rose for every three that fell on the New York Stock Exchange, while the number of advancers and decliners was almost the same on the Nasdaq.

Investors awaited comments from the Federal Reserve Open Market Committee, which is expected to hold interest rates near zero and repeat its vow of very low rates for an extended period. The statement is due at about 2:15 p.m. EDT.

Apple Inc and Amazon.com Inc weighed on the Nasdaq, with Apple off 0.7 percent to $260.15 and Amazon down 1.4 percent to $140.08.

Micron Technology Inc was off 3.4 percent at $9.98.

(Additional reporting by Leah Schnurr; editing by Jeffrey Benkoe)