The sale is the latest by Barrick Chief Executive Officer Mark Bristow as he seeks to shed at least $1.5 billion of unprofitable mines by the end of 2020, following the company's acquisition of Rangold Resources a year ago.

The Canadian miner last month sold its half of the Kalgoorlie super pit gold mine to Australia's Saracen Mineral Holdings Ltd for $750 million.

Barrick could also look to sell its Tongon mine in Ivory Coast and its Lumwana copper project in Zambia, analysts have said.

Barrick shares were up 1.2% in early Toronto trading while the benchmark Canadian share index was flat.

Tuesday's deal includes an upfront cash payment to Barrick of $300 million and Teranga shares worth a total of $80 million, giving Barrick close to an 11.5% stake in the miner.

Gold miners have notched transactions worth more than $30 billion this year as they seek to replace dwindling reserves and win back investors.

The consolidation has also led to a raft of mine sales around the world as top miners Barrick and Newmont Gold Corp focus on their best performing assets.

"You've seen a lot of these seniors consolidate and there are non-core assets for them that are quite meaningful for other companies like ourselves," Teranga Chief Executive Officer Richard Young told Reuters on Tuesday.

The price also includes a contingent payment of up to $50 million based on the average gold price for the three years from when the deal closes, the companies said.

Credit Suisse analyst Tariq Fahad said Barrick had now achieved 79% of its divestment target when the value of Teranga shares was included.

Barrick will have the right to nominate one Teranga director for as long as it retains at least a 10% equity interest in Teranga.

Teranga said it plans to combine the Massawa project with its flagship Sabodala gold project, creating a low-cost mid-tier producer with higher production and lower costs.

The company will invest up to $10 million to begin processing ore from Massawa in the second half of next year, Young said.

Barrick can increase its stake in Teranga after 18 months according to a standstill agreement reached by the companies.

By Jeff Lewis and Arunima Kumar