U.S. stocks rose Tuesday as investors scooped up recently battered tech shares amid a flurry of merger deals, including one between Sirius Satellite Radio (SIRI) and XM Satellite Radio (XMSR), and oil prices eased.

The Dow Jones industrial average gained 19.07 points, or 0.15 percent, to a record 12,786.64. The Standard & Poor's 500 Index added 4.14 points, or 0.28 percent, to 1,459.68. The Nasdaq Composite Index climbed 16.73 points, or 0.67 percent, to 2,513.04. The Dow earlier touched 12,795.93, a new intraday lifetime high for the average.

Click here to visit FOXBusiness.com's Investing Center.

Shares of Wal-Mart Stores Inc. (WMT) had their biggest percentage gain in nearly four months after the world's No. 1 retailer reported better-than-expected earnings, nudging the Dow to a fresh lifetime closing high.

"We had a number of takeovers in the market, oil prices drifted a little lower and investors selectively returned to tech stocks helping the Nasdaq finally break out of the 2,400 to 2,500 range," said Michael Sheldon, chief market strategist at New York brokerage Spencer Clarke.

Shares of Hewlett-Packard Co. (HPQ) declined in extended hours trading after the personal computer and printer maker reported earnings that were better than analysts' forecast, but not by a wide enough margin to spur the stock from its near six-year highs.

HP shares were down 0.9 percent to $42.75 in electronic composite trading after closing on the New York Stock Exchange at $42.77.

Among other M&A deals hatched over the holiday weekend, Britain's Shire Plc agreed to buy U.S. partner New River Pharmaceuticals for $2.6 billion and Vulcan Materials Co. said it will pay $4.6 billion in cash and stock for Florida Rock Industries Inc.

Offsetting Wal-Mart-driven gains on the Dow and S&P's were shares of Home Depot Inc. (HD) The world's largest home improvement retailer and a Dow component, reported a 28 percent drop in quarterly profit.

Home Depot shares dipped 0.2 percent at $41.34. Shares of Wal-Mart, the world's largest retailer, rose 3.7 percent to $50.26.

Sirius shares rose 6 percent to $3.92 on the Nasdaq, while XM Satellite shares jumped 10.2 percent to $15.41.

Florida Rock shares soared 41.7 percent to $66.54 while Vulcan stock slipped 0.6 percent to $111.14. New River shares gained 8.3 percent to $63.19.

Energy shares were sagging as oil futures dropped $1.32 to $58.07 a barrel. Exxon shed 0.6 percent to $74.87. Shares of oil field service provider Schlumberger Ltd. were the next biggest weight, falling 1.6 percent to $62.34 on the NYSE.

Trading was light on the NYSE, with about 1.33 billion shares changing hands, below last year's estimated daily average of 1.84 billion, while on Nasdaq, about 2.2 billion shares traded, above last year's daily average of 2.02 billion.

Advancing stocks outnumbered decliners by a ratio of about 8 to 5 on the NYSE and by more than 9 to 5 on Nasdaq.

A looming Bank of Japan policy meeting that could result in an increase in interest rates kept investors cautious.

Low Japanese rates have contributed to a surge in U.S. stocks by making it cheap for global investors to borrow, but that liquidity may begin to dry up if the BOJ were to raise rates on Wednesday.

Click here to visit FOXBusiness.com's Investing Center.