Stocks ripped higher to close near their best levels Wednesday, with the Dow and S&P 500 setting fresh highs, after the Federal Reserve surprised Wall Street by keeping its $85 billion-a-month bond-buying program intact.

(Read more: After-hours buzz:Oracle, McDonald's, Cisco & more)