Stocks ended an erratic session mixed Tuesday as investors weighed slightly higher oil prices against strong earnings from companies including Verizon Communications and Texas Instruments.

The major benchmarks wavered throughout the day as investors tracked fluctuations in crude oil futures. Rising oil prices, which could lead to lower consumer spending and declining corporate earnings, have shadowed stocks for months and distracted investors Tuesday from the current crop of upbeat earnings reports.

Wall Street also reacted strongly to any company news that strayed from expectations. Investors punished chemical maker DuPont because its sales fell below forecasts, but bid up Lockheed Martin, the nation's biggest defense contractor, whose forecast for the year was above expectations.

The Dow Jones industrial average fell 16.71, or 0.2 percent, to 10,579.77. The Standard & Poor's 500-stock index rose 2.13, or 0.2 percent, to 1231.16. The Nasdaq composite index rose 9.25, or 0.4 percent, to 2175.99.

Movers

DuPont fell $2.89, to $41.15, on disappointing sales, but it beat earnings forecasts.

Verizon, the nation's largest phone company, rose 11 cents, to $34.13, after second-quarter profit rose 19 percent.

Texas Instruments rose $1.70, to $32.30, after reporting that quarterly profit rose 42 percent.

Lockheed Martin, whose profit and forecast exceeded estimates, gained $1.48, to $63.99.

Sun Microsystems rose 13 cents, to $3.98, in extended trading after closing unchanged in the regular session. The company reported earnings in line with analysts' expectations.

Amazon.com gained $3.96, to $41.70, in extended trading after falling 21 cents in the regular session. Amazon reported sharply lower earnings, but beat analysts' estimates.

General Motors climbed $1.09, to $36.96, after its GMAC financial services unit said it will sell up to $55 billion worth of car loan contracts to Bank of America over the next five years.

Indexes

New York Stock Exchange composite index rose 4.82, to 7428.07.

American Stock Exchange index fell 6.56, to 1556.89.

Russell 2000 index of smaller-company stocks rose 3.59, to 674.58.

Volume

NYSE: 1.93 billion shares, up from 1.71 billion on Monday. Advancers outnumbered decliners 7 to 5.

Nasdaq: 1.68 billion shares, up from 1.51 billion. Advancers outnumbered decliners 11 to 8.

Commodities

Crude oil for September delivery: $59.20, up 20 cents.

Gold for current delivery: $423.40 a troy ounce, down from $425.70 on Monday.