(Corrects U.S. dollar figure in headline and first par to $3.4 billion from $3.2 billion)

SYDNEY - Canada's Goldcorp Inc agreed to buy gold miner Andean Resources Ltd for C$3.6 billion ($3.4 billion), trumping a competing offer from rival Eldorado Gold Corp .

The takeover is the latest in a series of mining deals this year, including Australia's Newcrest Mining's $8.4 billion purchase of rival Lihir Gold, as gold prices are hovering near a record high with global economic uncertainty driving investors to safer havens.

Goldcorp said its cash and share offer, at C$6.50 per share, was expected to close in late 2010 or early 2011 and had been unanimously approved by the boards of directors of both companies.

Goldcorp's offer topped Eldorado's all-share bid, worth C$6.36 a share, made hours earlier after the companies failed to agree.

Goldcorp's offer puts a 35 percent premium to Andean Resources last traded price on the Toronto exchange. Andean Australian-listed shares jumped 30.9 percent in Sydney trading to A$6.40 before it was placed on trading halt.

Andean's plan to sell does not come as a surprise. It was set up to be taken over at some stage. It was a question of how and what price. The pricing and the premium looks pretty reasonable. There might be a small window to move, said Tim Barker, Portfolio Manager at BT Financial Group.

Goldcorp said Andean's principal asset was its 100-percent owned Cerro Negro Gold project in the southern province of Santa Cruz in Argentina, which would add to its gold production pipeline.

Cerro Negro is the company's advanced-stage gold exploration project, which preliminary studies suggest may have resource of 3.1 million ounces of gold and 25 million ounces of silver as of March 2010, according to the company's website.

The mining sector is leading the global M&A activity, which recorded $267 billion worth of deals in August, making it the biggest month since June 2009, Thomson Reuters data showed.

The materials sector has seen a 30 percent rise in deals with global miner BHP Billiton leading the charge with a $39 billion offer for Canada's Potash

.

($1=1.052 Canadian dollar) (Additional reporting by Krishna N. Das in Bangalore; Editing by Valerie Lee)