The S&P 500 knocked on 1,400 before edging lower on Wednesday as investors digested the previous session's rally on the Federal Reserve comments on the economy and the banking sector.

Apple Inc shares, up 2.5 percent at $582.52, posted a sixth straight day of gains and helped to limit the broader market's losses. Apple's advance on Wednesday came after Morgan Stanley and Canaccord Genuity lifted the price target on the stock to above $700.

The Fed said most of the largest U.S. banks passed their annual stress tests of capital strength in a report that underscored the financial sector's recovery, but called out a few that failed, including Citi.

On Tuesday, the Fed also said it expects moderate growth over coming quarters with the unemployment rate declining gradually versus the modest growth the central bank said it expected in January. The change in language, used in the Fed's statement after a one-day policymakers' meeting, was seen as a slight upgrade of the economic outlook.

The three major stock indexes hit multi-year highs after Tuesday's rally, led by the banking industry. Volume on the New York Stock Exchange, NYSE Amex and Nasdaq was close to last year's daily average during March, a significant improvement compared with recent days.

We are still not seeing the kind of volume that would suggest this is comprehensively being bought into by all investors, said Gordon Charlop, a managing director at Rosenblatt Securities in New York. But people are able to tolerate more risk now.

The key takeaway is, can we hold (Tuesday's) gains?

Bank stocks, a major component of the S&P 500's 11 percent gain for the year, led a late-day surge in Tuesday's rally. The KBW Bank index <.BKX> was up 0.7 percent at midday on Wednesday, with its gain for the year at nearly 21 percent.

Bank of America , up 3.4 percent at $8.78, and American Express , up 3.1 percent at $55.93, ranked among the S&P 500's best performers. But Citigroup , Wells Fargo , Goldman Sachs and MetLife were among the benchmark's biggest drags.

The Dow Jones industrial average <.DJI> edged up 13.89 points, or 0.11 percent, to 13,191.57. The S&P 500 Index <.INX> dipped 2.08 points, or 0.15 percent, to 1,393.87. The Nasdaq Composite <.IXIC> shed 2.16 points, or 0.07 percent, to 3,037.72.

The S&P 500 hit a high of 1,399.42, its highest level since early June 2008. The 1,400 level could generate some resistance, but chartists point to the 1,425-1,440 area for the next technical hurdle.

Volume on the New York Stock Exchange, the American Stock Exchange and the Nasdaq hit 7.57 billion shares on Tuesday, near the 7.87 billion daily average in March 2011. The average so far in 2012 is 6.86 billion.

The increasing optimism about the economy helped lift the dollar to an 11-month high against the yen and a 1-month high versus the euro.

The greenback's advance alongside a strong equities market underscores investors' bet that the economic recovery is sustainable.

NXP Semiconductors rose 3.3 percent to $25.69 after Goldman Sachs added the chip maker to its conviction buy list and raised its price target to $30.

But Zynga Inc reversed its earlier gain, slipping 0.7 percent to $13.27. In morning trading, the stock had climbed to an intraday high of $13.70. Before the opening bell, Zynga announced a secondary offering of up to $400 million.

(Reporting by Rodrigo Campos; Editing by Jan Paschal)