Gold Fields Ltd. GFI, +3.01% GFI, +4.10% said Tuesday that it has agreed to buy Yamana Gold Inc. in an all-stock deal that values the Canadian company at $6.7 billion.

Under the deal, which has the support of the Yamana Gold YRI, +2.58% AUY, -0.96% board, accepting Yamana Gold shareholders will get 0.6 of a Gold Fields share for each share held, the company said.

The combined company will be based in Johannesburg with operations across Canada, Australia, South America, Ghana and South Africa.

“Yamana’s high-quality asset base in the Americas and strong development and exploration pipeline will further diversify the geography of our portfolio, creating a top-4 global gold major, well positioned to deliver long-term value creation,” Gold Fields Chief Executive Chris Griffith said.

Write to Ian Walker at ian.walker@wsj.com