NEW YORK (AP) -- Stocks wavered throughout the day but managed to eke out modest gains Monday as oil prices rose.
Investors bought drillers, refiners and other energy companies as the three-week rise in crude continued. Six of 10 industry sectors in the Standard & Poor's 500 rose, helping the index extend its winning streak to fifth day.
The ride up was bumpy, though, and the gains were slight. The S&P 500 gained just 0.09 percent. That was its smallest increase in seven weeks.
"Today's volatility is mostly about a little profit-taking and taking a pause after such a strong advance in recent days," said Jim Paulsen, chief investment strategist at Wells Capital.
The Dow Jones industrial average increased 67.18 points, or 0.4 percent, to 17,073.95. The S&P 500 edged up 1.77 points to 2,001.76. The Nasdaq composite, which is heavily weighted with technology stocks, gave up 8.77 points, or 0.2 percent, to 4,708.25.
Shares of consumer products and technology companies fell. Chipmaker Micron Technology fell 30 cents, or 2.5 percent, to $11.58.
With no big U.S. economic or earnings announcements, news from abroad appeared to drive much of the trading.
The price of iron ore jumped 17 percent on news over the weekend that China plans to run up its deficit to stimulate its economy. China is the world's largest buyer of this raw material for steel, and mining companies soared on the news. Cliffs Natural Resources rose 54 cents to $3.43, a gain of 19 percent.
China also lowered its official growth target this year to 6.5 to 7 percent. The slowdown has been rattling markets, although fears that the trouble could spill over into the U.S. economy have eased in recent weeks as encouraging U.S. data suggest growth is solid. On Friday, the government reported that employers added 242,000 jobs to their payrolls last month, more than had been expected.
"The market is correctly pricing in a lower chance of global recession or U.S. recession," said Brian Nick, head of tactical asset allocation at UBS Wealth Management Americas.
Investors are anxious over a policy meeting of the European Central Bank on Thursday as inflation across the 19-country eurozone has fallen back below zero. They expect further stimulus from the central bank, possibly including a cut in deposit rates further into negative territory. The Bank for International Settlements, which helps coordinate monetary policy around the world, warned on Monday of a "gathering storm" as central banks run out of room to stimulate their economies.
European markets were mostly lower, with France's CAC-40 and Britain's FTSE 100 each losing 0.3 percent. Germany's DAX dropped 0.5 percent.
Benchmark U.S. crude added $1.98, or 5.5 percent, to close at $37.90 a barrel on the New York Mercantile Exchange.
The 10 biggest gainers in the S&P 500 were drillers and other energy-related companies. Murphy Oil rose $2.99, or nearly 13 percent, to $26.69.
In Asia, Tokyo's Nikkei retreated 0.6 percent and Hong Kong's Hang Seng shed 0.1 percent. Seoul's Kospi advanced 0.1 percent.
In other oil trading, Brent crude, which is used to price international oils, rose $2.12, or 5.5 percent, to $40.84 a barrel in London
U.S. government bond prices fell. The yield on the 10-year Treasury note rose to 1.90 percent from 1.87 percent on Friday. The euro rose to $1.1013 from $1.0999 and the dollar fell to 113.27 yen from 114.02 yen.
Precious and industrial metals futures ended mixed. Gold fell $6.70 to $1,264 an ounce, silver slipped six cents to $15.63 an ounce and copper rose a penny to $2.28 a pound.