Nov 8 (Reuters) - Yamana Gold Inc said on Tuesday it had agreed to be acquired by Agnico Eagle Mines Ltd and Pan American Silver Corp, ending a deal with South Africa's Gold Fields.

The Agnico-Pan American cash-and-stock offer, made last week, values the Canadian miner at about $4.8 billion.

Gold Fields had agreed to buy Yamana in an all-stock deal valued at $6.7 billion in May.

But a slump in shares after the deal was announced dented the valuation and at Thursday's close Gold Fields' offer was worth just north of $4 billion.

Yamana said its board has changed its recommendation on the pending deal with Gold Fields and now unanimously recommends that shareholders vote against the merger.

The company said the move followed Gold Fields' decision not to change its original offer. (Reporting by Arunima Kumar in Bengaluru; Editing by Sriraj Kalluvila)