U.S. stocks closed mostly higher on Tuesday, led by gains in energy, mining and financial companies.
The Dow Jones industrial average and the Standard & Poor's 500 index eked out small gains. The tech-heavy Nasdaq composite closed modestly lower, reflecting a slump in technology stocks, which were dragged down by Netflix and IBM.
The gains in energy and mining companies came as prices for oil, copper and other basic materials rose.
Investors were mostly focused on the latest batch of corporate earnings and on what company managers have to say about their prospects for growing profits this year.
"The market is focused on where we are going to be three months from now, five months from now," said Quincy Krosby, market strategist at Prudential Financial. "It's all about the guidance, and it's also all about what companies are doing to beat on the bottom line."
The Dow rose 49.44 points, or 0.3 percent, to 18,053.60. The S&P 500 index gained 6.46 points, or 0.3 percent, to 2,100.80. The Nasdaq fell 19.69 points, or 0.4 percent, to 4,940.33.
Expectations for earnings are low this quarter, with corporate profits for companies in the S&P 500 projected to be down 8.1 percent, according to S&P Global Market Intelligence. Even excluding the beaten-down energy sector, earnings growth for the S&P 500 companies is expected to be down 3.4 percent.
All of the earnings growth this year is expected to come in the second half of 2016, noted Erin Gibbs, equity chief investment officer at S&P Global Market Intelligence.
Several companies delivered quarterly results that put investors in a buying mood Tuesday.
Johnson & Johnson gained 1.6 percent after its first-quarter earnings beat Wall Street's expectations. Higher sales of new prescription drugs and other key medicines nearly offset a big hit from the strong dollar. The stock added $1.75 to $112.68.
UnitedHealth Group added 2.1 percent after it reported strong results for the first quarter and raised its guidance for the year. The health insurer also said it would cut back on participating in Affordable Care Act health care exchanges in a bid to stem losses related to the program. The stock gained $2.69 to $130.50.
Goldman Sachs' latest results also gave the investment bank's shares a lift. Goldman's earnings beat Wall Street's estimates, even though its profit sank by 56 percent from a year earlier. The stock rose $3.63, or 2.3 percent, to $162.65.
Kansas City Southern gained 4.6 percent after the railroad operator posted larger-than-expected quarterly earnings. The stock climbed $4.55 to $96.02.
Some companies' quarterly snapshots and outlooks failed to impress traders.
Netflix slumped 13 percent, a day after the streaming video company gave a disappointing forecast for subscriber additions and reported first-quarter revenue that fell short of financial analysts' forecasts. The stock lost $14.06 to $94.34.
IBM delivered improved first-quarter earnings thanks to a big tax refund, but also had lower revenue amid weaker software sales. The stock slid $8.53, or 5.6 percent, to $144.
Illumina sank 23.2 percent after the genetic testing tools maker predicted that sales in the first quarter will be far lower than analysts expected. Illumina shares were down $41.25 at $136.88.
This week, about 100 of the companies in the S&P 500 names are due to report quarterly results.
Beyond earnings, the market pushed up prices for mining and energy companies as the price of oil, natural gas, metals and other materials rose.
Freeport-McMoRan gained 99 cents, or 9 percent, to $12.01, while Newmont Mining rose $1.45, or 4.9 percent, to $30.91.
Williams Cos. was among the energy and drilling services companies to get a boost. It jumped $1.33, or 8 percent, to $18.01, while Oneok climbed $2.23, or 6.9 percent, to $34.39. Diamond Offshore Drilling rose $1.41, or 6.3 percent, to $23.76.
Benchmark U.S. crude rose $1.30, or 3.3 percent, to close at $41.08 a barrel in New York. Brent crude, the international benchmark, gained $1.12, or 2.6 percent, to close at $44.03 a barrel in London. Natural gas jumped 15 cents, or 7.6 percent, to close at $2.088 per 1,000 cubic feet.
Upbeat economic data and a rebound in oil prices lifted European markets.
Germany's DAX was up 2.3 percent, while France's CAC 40 was up 1.3 percent. Britain's FTSE 100 was up 0.8 percent. Earlier in Asia, Japan's Nikkei rallied 3.7 percent a sharp loss on Monday. South Korea's Kospi rose 0.1 percent, while Hong Kong's Hang Seng index gained 1.3 percent.
In other energy trading, wholesale gasoline rose about 4 cents, or 3 percent, to close at $1.48 a gallon. Heating oil added 3 cents, or 2.2 percent, to close at $1.26 a gallon.
Precious and industrial metals futures ended sharply higher. Gold rose $19.30, or 1.6 percent, to $1,254.30 an ounce, silver gained 72 cents, or 4.4 percent, to $16.97 an ounce and copper rose 6 cents, or 2.7 percent, to $2.22 a pound.
Bond prices fell. The yield on the 10-year Treasury note rose to 1.79 percent from 1.77 percent late Monday.
In currency markets, the yen resumed its slide with the dollar strengthening to 109.13 yen from 108.82 yen. The euro rose to $1.1377 from $1.1314.