NEW YORK — Investors set aside some of their concerns about mounting debt levels around the world and looked for bargains after a two-day slide in stocks.
Stocks turned higher late Wednesday after a day of back-and-forth trading. Investors have been cautious about rising government debt levels in Spain, Greece and other countries.
The Dow Jones industrial average rose 51 points to regain about half of what it lost a day earlier.
Investors spent much of the day looking for safety following a decision by credit rating agency Standard & Poor's to reduce the outlook on Spain's debt rating.
S&P's move came a day after another agency lowered its credit rating on Greece's government. Investors have been watchful for other signs of problems with global debt ever since a state-run company in Dubai shocked investors two weeks ago by asking its creditors for a debt reprieve.
Meanwhile, stocks again followed moves in the dollar, as they have for months. When it falls, the dollar makes commodities cheaper for foreign buyers and increase profits for U.S. companies that do business outside the U.S.
The dollar has steadied this week against other major currencies, interrupting a steady drop since March. The greenback has fallen as investors take advantage of cheap financing to invest in riskier, higher-yielding assets like stocks and commodities. Signs that the economy is improving have cut into demand for safe-haven investments.
In recent weeks, however, investors have been shuttling between buying stocks and hoarding cash as they try to lock in some of the big gains they've amassed in stocks since a rally started in March.
As the end of the year approaches, many investors have been building up defensive investments like Treasurys. The uncertain tone in the market, combined with light trading volume, has made for choppy trading, which analysts expect to continue through the rest of the year.
Tom Phillips, president of TS Phillips Investments in Oklahoma City, said he expects the dollar will lose its pull over the stock market because so many traders have placed bets that the currency will fall and boost stocks.
"When everybody understands the game the game doesn't work as well," he said. "I think it will just fray and start to erode."
According to preliminary calculations, the Dow rose 51.08, or 0.5 percent, to 10,337.05 after falling 104 on Tuesday. The S&P 500 index rose 4.01, or 0.4 percent, to 1,095.95, while the Nasdaq composite index rose 10.74, or 0.5 percent, to 2,183.73.
The ICE Futures US dollar index, which tracks the dollar against other major currencies, fell 0.3 percent.
Investors grew concerned that heavy debt loads in countries like Greece and Spain as well as the U.S. and Britain could signal that the threat of defaults and higher borrowing costs could upend a nascent global economic rebound.
While investors want to see the economy grow, they also know that the Federal Reserve could raise interest rates and remove other stimulus measures once the economy appears to be on solid footing. Higher rates could make stocks look less appealing as returns for other investments improve, potentially upsetting a nine-month advance in stocks that has lifted the S&P 500 index by 61.4 percent.
Not all the day's news was downbeat. The Commerce Department reported that businesses added to inventories at the wholesale level in October after a record 13 straight months of reductions. Investors hope it is a sign that businesses will soon start restocking store shelves. Wholesale inventories rose 0.3 percent in October; economists had expected a 0.5 percent drop.
Hugh Johnson, chairman and chief investment officer of Johnson Illington Advisors in Albany, N.Y., said signs of improvement in the economy are disrupting advances in the markets because traders predict the Fed will be forced to raise interest rates sooner than expected to keep inflation in check.
The government reported Friday that employers cut the fewest jobs in November since the recession began two years ago. The figures were far better than expected and prompted a re-evaluation of where the Fed stands, despite comments from Fed Chairman Ben Bernanke that interest rates will remain low.
"That's going to be tough to defend," Johnson said, referring to the Fed's stance on rates. "That's why investors have started to rethink all of the things that have made money over the past nine months."
In other trading, Treasurys fell, sending yields higher. The yield on the benchmark 10-year Treasury note rose to 3.44 percent from 3.39 percent late Tuesday.
An analyst upgrade of manufacturing conglomerate 3M Co. helped lift the Dow industrials after it dragged the index down after issuing a profit forecast that disappointed investors. 3M rose $2.63, or 3.4 percent, to $79.74.
Gold slid, while oil fell $1.95 to settle at $70.67 per barrel on the New York Mercantile Exchange.
The Russell 2000 index of smaller companies rose 0.33, or 0.1 percent, to 598.03.
Advancing stocks narrowly outpaced those that fell on the New York Stock Exchange, where volume to 1.1 billion shares compared with 1.2 billion Tuesday.
Overseas, Britain's FTSE 100 fell 0.4 percent, Germany's DAX index and France's CAC-40 each lost 0.7 percent. Japan's Nikkei stock average fell 1.3 percent.