Stocks meandered to a mixed finish Tuesday as higher oil prices pressured the market, but the Standard & Poor's 500-stock index neared a four-year high in a sign of Wall Street's underlying bullishness.
While there was little news to give the markets a clear direction, the stock market held on to the gains of the past three sessions, which saw the major benchmarks jump roughly 3 percent. Strong earnings from PepsiCo and others helped investors remain positive.
That helped Wall Street withstand another surge in crude futures. Oil prices rose above $60 per barrel as traders worried about another active hurricane season in the Gulf of Mexico.
The S&P 500 rose 2.77, or 0.2 percent, to 1222.21, just 3 points shy of its four-year high of 1225.31, reached March 7. The index briefly surpassed that level before edging back in the last hour of trading.
The other major benchmarks were mixed. The Nasdaq composite index rose 7.72, or 0.4 percent, to 2143.15, its best close since Jan. 3, while the Dow Jones industrial average fell 5.83, or 0.1 percent, to 10,513.89. The Dow's dip was unsurprising given the higher price of oil and the average's bent toward energy-sensitive industrial companies.
PepsiCo rose 75 cents, to $54.60, as sales of its Quaker Foods cereals and products boosted earnings by 13 percent over the previous quarter. The company beat Wall Street profit forecasts by 3 cents per share.
Hudson United Bancorp of New Jersey surged $4.14, or 11 percent, to $41.64, after it agreed to be purchased by Portland, Maine-based TD Banknorth for $1.9 million in cash and stock. TD Banknorth fell 86 cents, to $29.10.
ConocoPhillips, the biggest U.S. oil refiner, increased 66 cents, to $61.57, as energy shares climbed with the price of oil. Chevron gained 21 cents, to $57.51. Marathon Oil rallied $1.27, to $57.70.
Home Depot, the world's biggest home-improvement retailer, advanced $1, or 2.5 percent, to $41.30, for the best performance in the Dow average. Rival Lowe's increased $1.68, to $62.41.
New York Stock Exchange composite index rose 29.35, to 7411.85.
American Stock Exchange index rose 11.42, to 1583.78.
Russell 2000 index of smaller-company stocks fell 0.95, to 670.79.
NYSE: 1.94 billion shares, up from 1.84 billion on Monday. Advancers outnumbered decliners 4 to 3.
Nasdaq: 1.64 billion shares, down from 1.77 billion. Advancers narrowly outnumbered decliners.
Crude oil for August delivery: $60.62, up $1.70.
Gold for current delivery: $426.30 a troy ounce, up from $425.50 on Monday.