Striking South African gold miners have agreed to a sign a pay deal that would end months of often violent labour unrest, the country's main mining union said on Thursday.

"Members have accepted a new pay structure," the National Union of Mineworkers said. "The worst in the gold sector is over," spokesman Lesiba Seshoka told AFP.