(AP) -- US stocks finished broadly higher Wednesday, giving the S&P 500 its third gain in as many days.
Energy companies rose more than the rest of the market, riding a big upturn in crude oil prices. Solid gains in industrial stocks and retailers outweighed losses among food and beverage companies, technology stocks and banks.
Investors continued to bid up companies that reported positive earnings or outlooks. Not all companies delivered welcome results. IBM slumped 7.5 percent, single-handedly pulling the Dow Jones industrial average into the red.
"Earnings are the principal thing this week," said Paul Christopher, head of global market strategy for Wells Fargo Investment Institute. "The market wants to see more consistent evidence of strong earnings."
The S&P 500 index rose 2.25 points, or 0.1 percent, to 2,708.64. The Dow slid 38.56 points, or 0.2 percent, to 24,748.07. The Nasdaq composite gained 14.14 points, or 0.2 percent, to 7,295.24. The Russell 2000 index of smaller-company stocks picked up 3.76 points, or 0.2 percent, to 1,583.56.
The major stock indexes are all on track to finish the week higher.
Bond prices fell. The yield on the 10-year Treasury rose to 2.87 percent from 2.83 percent late Tuesday.
Investors continued to sift through corporate earnings reports. Financial analysts are forecasting the strongest growth in seven years for S&P 500 companies, partly because of a resurgent global economy, but also because of expectations that last year's corporate tax cut will have on corporate balance sheets.
Roughly 10 percent of the companies in the S&P 500 have reported results so far this earnings season, and some 67 percent of those have delivered both earnings and revenue that exceeded financial analysts' expectations, according to S&P Global Market Intelligence.
Railroad operator CSX jumped 7.8 percent to $61.01 and aircraft maker Textron climbed 6.8 percent to $63.99 after reporting results that beat analysts' forecasts.
United Continental rose 4.8 percent to $70.58 after the airline company raised its earnings outlook for the year.
Best Buy added 3.6 percent to $75.40 after announcing a partnership to sell Fire TVs with Amazon.
IBM was the biggest decliner in the S&P 500, sliding 7.5 percent to $148.79. That's its biggest loss in five years. The technology company's results failed to impress investors.
Oil futures surged, pushing closer to $70 a barrel. The pickup in the price of crude came as Reuters published a report citing unnamed industry sources saying that Saudi Arabia would be happy to see crude oil prices hit $100 a barrel.
Benchmark U.S. crude rose $1.95, or 2.9 percent, to settle at $68.47 per barrel on the New York Mercantile Exchange. Brent crude, used to price international oils, added $1.90, or 2.7 percent, to close at $73.48 per barrel in London.
"If you look at the activity in oil over the last couple of weeks, it almost seems like it's destined to flirt with the $70 level to see if it can break through," said JJ Kinahan, chief market strategist for TD Ameritrade. "The market seems very comfortable between this $58 and $70-ish area."
The surge in oil prices helped lift energy stocks. Newfield Exploration added 5.9 percent to $28.89.
The dollar gained to 107.26 yen from Tuesday's 107.02 yen. The euro rose to $1.2377 from $1.2367.
Gold rose $4 to $1,353.50 an ounce. Silver gained 46 cents, or 2.7 percent, to $17.25 an ounce. Copper added 8 cents to $3.16 a pound.
In other energy futures trading, heating oil rose 3 cents to $2.09 a gallon. Wholesale gasoline picked up 3 cents to $2.07 a gallon. Natural gas was little changed at $2.74 per 1,000 cubic feet.
Major stock indexes in Europe finished mostly higher. Germany's DAX was ended flat, while France's CAC 40 rose 0.5 percent. Britain's FTSE 100 added 1.3 percent. Indexes in Asia ended higher. Tokyo's Nikkei 225 rose 1.4 percent, while Hong Kong's Hang Seng added 0.7 percent. Seoul's Kospi rose 1.1 percent.