Stocks extended gains on Wednesday as investors scooped up financial and technology shares, and Merck & Co benefited from a brokerage upgrade.

Chinese search engine Baidu Inc helped the Nasdaq outperform the Dow and S&P 500 indexes after rival Google Inc said it may shut its Chinese-language website. Baidu surged more than 13 percent.

The Dow Jones industrial average <.DJI> rose 42.63 points, or 0.40 percent, to 10,669.89. The Standard & Poor's 500 Index <.SPX> gained 7.33 points, or 0.65 percent, to 1,143.55. The Nasdaq Composite Index <.IXIC> added 21.81 points, or 0.96 percent, to 2,304.12.

(Reporting by Leah Schnurr; Editing by Padraic Cassidy)