JOHANNESBURG (AP) — A South African union representing tens of thousands of miners who have been on strike for five months has reached a wage deal with platinum-producing companies to end the protest, the head of the union said Monday.

The agreement will be signed on Tuesday and workers will return to work on Wednesday, said Joseph Mathunjwa, head of the Association of Mineworkers and Construction Union.

"This means the strike is officially over," the South African Press Association quoted Mathunjwa as saying in an address to 20,000 union members at a stadium near Rustenburg, a town in a key platinum-producing area.

The union chief described the agreement as a victory.

The companies — Lonmin, Impala Platinum and Anglo American Platinum — estimate the strike has cost several billion dollars in lost earnings for workers as well as company revenue. The industry is a pillar of the struggling South African economy.

South Africa is a major producer of platinum, which is used in medical, electronic and other industries.

In 2012, South African police fatally shot several dozen protesters during labor unrest at a Lonmin platinum mine in Marikana, near Rustenburg. There was sporadic violence during the strike this year.

One miner, Asavelu Mncube, said he was relieved the strike was over.

"I am waiting for my back pay so that I can catch up with life," the South African Press Association quoted him as saying. "We lost a lot during the strike, but it was for a good cause."