* U.S. stocks rebound, close flat on weak housing data
* Government debt prices rise on poor U.S. housing data
* Euro rebound stalls on Spain debt worries, U.S. data
* Crude oil prices rebound on mixed inventory data (Updates with close of U.S. markets)
By Herbert Lash
NEW YORK, June 16 (Reuters) - U.S. stocks closed flat on Wednesday, battered by weak housing data that underscored an uneven recovery, while the euro slipped against the dollar on renewed concerns about Spain's credit and banking system.
U.S. housing starts in May fell to a five-month low, raising risk aversion among investors, even though stronger-than-expected U.S. industrial production helped keep stock and currency losses in check.
U.S. government debt prices rose on the housing data, which added to fears the U.S. economic recovery remains tentative. Industrial metal prices mostly fell, with U.S. copper futures snapping a six-day rally.
U.S. stocks initially traded down, then rebounded on news that BP had reached a tentative agreement to open an escrow fund demanded by U.S. President Barack Obama to provide for claims from its Gulf of Mexico oil spill.
BP's New York-traded shares rose 1.5 percent, although they have shed almost half their market value since the Gulf of Mexico oil spill occurred in April.
The Dow Jones industrial average <.DJI> added 4.69 points, or 0.05 percent, to 10,409.46. The Standard & Poor's 500 Index <.SPX> edged down just 0.62 of a point, or 0.06 percent, to 1,114.61. And the Nasdaq Composite Index <.IXIC> inched up just 0.05 of a point, or 0.00 percent, to 2,305.93.
"The industrial production number is saying that demand is still there, production is still there," said Marc Pado, U.S. market strategist at Cantor Fitzgerald & Co. in San Francisco. "That's telling me there is going to be a nice little increase in profit margins, even on flat revenue."
The MSCI world equity index <.MIWD00000PUS> rose 0.3 percent after hitting its highest level since mid-May earlier in the session. The MSCI emerging markets index <.MSCIEF> rose 0.6 percent.
Gains in U.S. Treasuries were muted as U.S. stocks traded close to flat for most of the day, and as tight correlation between debt and stock prices continued to dominate markets.
Benchmark 10-year Treasury notes
The S&P 500 stayed above its 200-day moving average a day after exceeding that level for the first time in a month. Investors took that as a positive signal because they view the 200-day average as an important momentum indicator.
Though still up 1.6 percent this week, the euro failed for a second day to break convincingly through the $1.2350 area, retreating after a Spanish newspaper reported that the European Union, International Monetary Fund and U.S. Treasury were drawing up an emergency credit line for Spain.
The European Commission denied the report, but the premium investors demand to hold 10-year Spanish bonds over German bunds hit the highest level in the euro's 11-year history. [ID;nLDE65F0GX]
"Worries about Spain's situation wiped out whatever risk appetite was left in the market," said Matthew Strauss, senior analyst at RBC Capital Markets in Toronto. "The euro had a good run from below $1.19 last week to around $1.2350, but failure to go further is reflective of the underlying market anxiety."
The euro was last changing hands at $1.2305
Against the yen, the euro was off 0.2 percent at 112.46 yen
Gold moved modestly lower as some short-term investors took profits off an early rise to a one-week high above $1,237 an ounce. Declines in the euro and in U.S. stocks hit gold in late trade.
U.S. gold futures for August delivery
U.S. crude oil rose for a third straight day, ending a choppy session at a six-week high amid the mixed economic data and a government inventory report that showed crude oil stocks rose and gasoline stocks fell last week.
"The ability of the energy complex to advance significantly today without much assistance from the euro or equities suggests an energy momentum play at work," Jim Ritterbusch, president at Ritterbusch & Associates, said in a note.
U.S. crude for July delivery rose 73 cents, or 0.95 percent, to settle at $77.67 a barrel, the highest close since May 5.
In London, ICE Brent crude for August delivery rose $1.04 to settle at $78.14 a barrel. (Reporting by Rodrigo Campos, Wanfeng Zhou, Emily Flitter in New York; Joanne Frearson, Emma Farge, Jan Harvey and Ian Chua in London; Writing by Herbert Lash; Editing by Leslie Adler)