NEW YORK (MarketWatch) — U.S. stocks finished mostly higher Tuesday after European officials agreed to another round of aid for Greece, pushing the Dow industrials briefly above 13,000 for the first time since 2008.

“When the market is on a roll it’s on a roll,” said Adrian Day, president of Day Asset Management in Annapolis, Md.

“We know we’re going to be revisiting Greece in a few months,” Day added.

After topping 13,000 for the first time since May 2008, the Dow Jones Industrial Average DJIA, -0.47% ended at 12,965.69, up 15.82 points, or 0.1%. It last closed above 13,000 on May 19, 2008.

Dow component Home Depot Inc. HD, -0.08% , was among those that lifted the blue chips after the home-improvement retailer reported a profit that topped Wall Street’s expectations.Read Home Depot story.

Wal-Mart Stores Inc. WMT, -0.08% fell 3.9%, with the discount retailer weighing on the Dow after its earnings fell short of estimates. Read Wal-Mart story.

The S&P 500 Index SPX, -0.48% climbed as high as 1,367.76, just points from 1,370, its May 2011 high. It finished at 1,362.21, up nearly 1 point, or not quite 0.1%, and its highest close since April 29, 2011.

Between that day and Oct. 3, 2011, the S&P fell 19%. Since that drop, the index has risen more than 24%.

“Even if you believe this is a bull market, the market needs to be able to absorb its gains in order to get a better footing going forward,” said Howard Silverblatt, senior analyst at S&P Indices.

The Nasdaq Composite COMP, -0.29% fell 3.21 points, or 0.1%, to 2,948.57.

Advancers held a slight edge over decliners on the New York Stock Exchange, where almost 798 million shares traded. Composite volume neared 3.8 billion.

Dow flirts with 13,000

On the New York Mercantile Exchange, crude-oil futures CLH22, -3.53% finished at $105.84 a barrel, up $2.60, and gold futures GCJ2 gained $32.60 to end at $1,758.50 an ounce. See story on oil futures.

Though the price of oil is still important, it is less so than in years past, Day noted.

“We’re much more efficient users of energy than we used to be, and the economy is less manufacturing denominated than service, so the input of oil per output of production is considerably less than it was,” Day said.

“We had good news on Greece, and good news on earnings, and that is overwhelming the price of oil,” said Day of the muted impact on investor sentiment of oil’s rise to a nine-month high.

In Brussels, euro-area finance ministers approved another rescue for debt-encumbered Greece. The 130 billion euros, or $173 billion, financial package still left doubts, however, about how durable the fix would prove.

An analysis by European and International Monetary Fund officials reportedly concluded Greece’s debt could widen to 160% of its gross domestic product in 2020.Read more about Greek deal.

“This is a short-term solution that permits you to rebuild, but you still have to rebuild,” S&P’s Silverblatt said.