Media playback is unsupported on your device Media caption The BBC's Milton Nkosi says up to seven people were killed

Police in South Africa have opened fire during clashes with striking workers at the Marikana platinum mine, leaving at least 12 people dead, witnesses say.

Police opened fire after miners carrying machetes, clubs and spears refused to disarm, eyewitnesses said.

A witness told the BBC he saw 18 bodies on the ground after the shooting.

The mine, owned by Lonmin, has been at the centre of a violent pay dispute, exacerbated by tensions between two rival trade unions.

Ten people had previously died in violence since the strike began last Friday.

The striking miners had gathered on a rocky hill overlooking Marikana, the third-largest platinum mine in the world.

Image copyright Reuters Image caption Several injured people were treated at the scene after the violence

Union leaders and police had tried in vain to disperse the crowd, some of whom said they were prepared to die on the hill.

During the clashes, missiles - thought to be either petrol bombs or grenades - were thrown at police, who responded by opening fire, eyewitnesses said.

Reports said a group of miners had approached police lines before the shooting began.

One witness, Molaole Montsho, of the South African news agency Sapa, told the BBC police had first used tear gas in an attempt to disperse the miners.

"The police threatened with them water from the water cannon, fired tear gas and stun grenades. And then in the commotion - we were about 800m (2,600ft) from the scene - we heard gunshots that lasted for about two minutes," he said.

He also said he had counted 18 bodies lying on the ground after the gunfire, but could not tell whether they were dead or alive.

'Illegal gatherings'

The police ministry acknowledged that there had been deaths, but defended the police's actions.

"To protest is a legal and constitutional right of any citizen," spokesman Zweli Mnisi told the AFP news agency in a text message.

"However, these rights do not imply that people should be barbaric, intimidating and hold illegal gatherings. We had a situation where people who were armed to the teeth attacked and killed other."

President Jacob Zuma said he was "shocked and dismayed at this senseless violence".

"We call upon the labour movement and business to work with government to arrest the situation before it deteriorates any further," said Mr Zuma.

"I have instructed law enforcement agencies to do everything possible to bring the situation under control and to bring the perpetrators of violence to book."

The recent violence was initially thought to have been triggered by a turf war between the long-established National Union of Mineworkers (NUM) and the newly-formed Association of Mineworkers and Construction Union (AMCU), which is more militant.

However, the AMCU has since demanded a pay rise of 12,000 rand ($1,500; £930) per month.

Lonmin said in a statement on Thursday that the strike was illegal and that any striking workers who did not return to work by Friday would be sacked.

The company said it had missed six days of production as a result of the unrest, and estimated it would lose around 2% of its normal yearly output of saleable platinum. The company's share price dropped by more than 6% on Thursday on the London Stock Exchange.

The violence has shocked South Africans, with many finding the scenes reminiscent of how the apartheid regime dealt with protests, the BBC's Milton Nkosi in Johannesburg reports.