U.S. stocks closed near break-even on Wednesday despite fresh signs of a modest economic recovery, while rising U.S. crude stockpiles led oil prices to extend sharp losses from the previous session.

News that China would act to restrict redundant investments underscored concerns about the global economy and triggered safe-haven buying of the U.S. dollar. For details:

Gold futures ended a tad lower, helped by the dollar's gains, while copper was little changed, weighed down by Chinese constraints on industrial overcapacity.

Investors remained cautious after a decent run-up in equity markets, leaving stocks to edge up on the day even after solid reports on U.S. housing and new orders of durable goods.

It seems like traders have lost the momentum after a huge upward move and they are finally taking a breather, said Fred Dickson, market strategist at D.A. Davidson & Co in Lake Oswego, Oregon.

The MSCI all-country world index <.MIWD00000PUS> rose for six straight session through Tuesday, gaining 5.3 percent over the stretch. The index was down 0.4 percent on Wednesday, but still up about 4 percent in August.

The Dow Jones industrial average <.DJI> closed up 4.23 points, or 0.04 percent, at 9,543.52. The Standard & Poor's 500 Index <.SPX> added 0.12 points, or 0.01 percent, to 1,028.12. The Nasdaq Composite Index <.IXIC> ended up 0.20 points, or 0.01 percent, at 2,024.43.

Orders for long-lasting U.S. manufactured goods registered the biggest advance since July 2007, but excluding transportation goods, orders for durables were slightly below expectations.

Slippage among global stocks that climbed to 10-month highs this week boosted money flows into less risky assets, such as European government bonds, which also gained from some modest month-end buying, traders said.

Economic data in Europe showed further signs of recovery, as did a report showing U.S. new home sales jumped in July to their fastest pace in 10 months.

The market has come a long way, and the economics are still supportive, said Georgina Taylor, an equity strategist at Legal & General Investment Management.

We're just seeing a little profit taking. Nothing has been derailed. Housing data is improving. The only area of concern is consumer spending.

U.S. stocks seesawed after market sell-offs on Monday and Tuesday, leading investors to turn skittish.

Oil pared early gains to drop to almost $71 a barrel, extending losses from the previous session, on the rise in U.S. stockpiles of crude.

The U.S. Energy Information Administration (EIA), the statistical arm of the Department of Energy, reported on Wednesday that crude stocks in the world's largest energy consumer rose by 200,000 barrels last week.

U.S. crude for October fell 62 cents to settle at $71.43 a barrel, after sliding $2.32 on Tuesday. Brent crude fell 17 cents to $71.65.

U.S. Treasuries edged higher as solid demand at a $39 billion auction of five-year government debt offset data suggesting the moribund U.S. housing market was stabilizing.

Treasuries held up well in the face of a large sale of five-year debt, with the auction results and placid market reaction suggesting the government was having no problems financing a burgeoning national debt.

For such a large slug of money to be taken down in a quiet time of the summer it's pretty noteworthy. It's pretty strong on the whole, said George Goncalves, head of fixed income rates strategy at Cantor Fitzgerald LP in New York.

The benchmark 10-year Treasury note was last trading up 1/32 on the day, yielding 3.44 percent.

U.S. December gold futures settled down 20 cents at $945.80 an ounce in New York.

Japan's Nikkei share average closed up 1.4 percent <.N225> to a fresh 10-month high, while the MSCI index of Asia Pacific stocks traded outside Japan rose 0.3 percent <.MIAPJ0000PUS>.

(Reporting by Richard Valdmanis, Angela Moon, Stephen C. Johnson and Burton Frierson in New York; Brian Gorman, Kirsten Donovan and Simon Falush in London; writing by Herbert Lash)