TORONTO - Canada's Goldcorp Inc (G.TO) said on Thursday it will spend $513 million to buy mining giant Xstrata's (XTA.L) 70 percent interest in the El Morro copper-gold project in Chile, foiling Barrick Gold's (ABX.TO) plans to acquire the stake.

Goldcorp will acquire the stake through a creatively structured deal with New Gold Inc (NGD.TO), Xstrata's partner in El Morro.

In October, Xstrata agreed to sell its interest in the project to Canada's Barrick, the world's No. 1 gold miner, for $465 million. But New Gold, another Canadian miner, had the right of first refusal on Barrick's purchase -- meaning it had the right to match the offer -- until January 2010.

New Gold, through a wholly owned subsidiary, will exercise its right of first refusal and acquire the 70 percent interest.

Goldcorp will advance $463 million to New Gold to fund the purchase. After the acquisition of the stake by the New Gold subsidiary, Goldcorp will acquire that subsidiary from New Gold.

Goldcorp will pay New Gold $50 million in cash upon closing the acquisition of the subsidiary. Goldcorp has also agreed to amend certain terms of the El Morro shareholders agreement, with respect to New Gold's capital funding obligations.

On closing the deal, Goldcorp will hold 70 percent of El Morro and New Gold 30 percent.

El Morro is an advanced stage copper-gold project located in north-central Chile. It contains proven and probable reserves of 6.7 million ounces of gold and 5.7 billion pounds of copper.

New Gold shares were up 7.7 percent at C$4.33 in early trade on the Toronto Stock Exchange on Thursday, while those of Goldcorp fell 14 Canadian cents to C$43.24.

($1=C$1.03 Canadian)

(Reporting by Euan Rocha; editing by Peter Galloway)