(CNN) — U.S. stocks moved higher Tuesday, with the Dow and S&P 500 rising to new 5-year highs, as investors grew hopeful about a potential merger between OfficeMax and Office Depot.
The Dow Jones industrial average, S&P 500 and Nasdaq added 0.4%.
Investors have been pulling back a bit after the strong start to the year. All three indexes are up between 5% and 7%, with the Dow just 1.3% shy of its all-time high, hit in October 2007. The S&P 500 is about 4% below its record high, also set in October 2007.
Driving the gains Tuesday were shares of OfficeMax and Office Depot, which both rallied after media reports said the companies were in advanced merger talks, citing unnamed sources. Staples, the other major office supplies retailer, gained about 16%.
The talks come as mergers and acquisitions have picked up. Just last week, US Airways announced a merger with American Airlines parent AMR, Warren Buffett's Berkshire Hathaway announced it was buying ketchup maker Heinz, and Comcast announced a $16.7 billion deal for the 49% of NBC Universal that was still owned by General Electric.
Best Buy shares rose 4% after the electronics retailer announced late Friday that it plans to make its price-matching program permanent, starting March 3.
Shares of Google advanced more than 3%, rising to a new all-time high of $803.58 per share.
Dell and controversial nutritional supplements company Herbalife will announce their quarterly results after the closing bell.
A hearing is scheduled Tuesday in David Einhorn's lawsuit against Apple Einhorn's hedge fund, Greenlight Capital has accused Apple of hoarding billions in cash and wants a judge to block a "bundled" shareholder vote, scheduled for Feb. 27. Einhorn wants shareholders to vote separately on an Apple proposal that would limit the company's ability to issue high-yielding preferred stock.
Apple CEO Tim Cook has called the lawsuit a "silly sideshow."
The National Association of Home Builders's Housing Market index fell for the first time in nearly a year in February. The index slipped to 46 in February, from 47 in January. Economists were expecting the index to rise to 48, which would have put builder confidence is at a six-year high.
Separate reports on housing starts and building permits will follow on Wednesday, and data on existing home sales will be released Thursday.
European markets were firmer in afternoon trading, lifted by a stronger-than-expected reading from the latest ZEW survey of German investor sentiment.
Asian markets closed lower. The Shanghai Composite lost 1.6%, the Hang Seng declined 1% and the Nikkei dropped 0.3%.
Gas prices rose for the 33rd day in a row. Economists are monitoring rising gas prices to gauge whether they will take a bite out of consumer spending in February.
Nationwide, a gallon on unleaded gasoline averaged about $3.748 Tuesday, according to AAA. Gas prices have risen about 33 cents, or nearly 10%, since the beginning of February.
Oil and gold prices edged higher.
The dollar lost ground versus the euro, the British pound and the Japanese yen.
The price on the 10-year Treasury rose, pushing the yield down to 1.99% from 2% late Friday.