JOHANNESBURG (Reuters) - South Africa's main opposition party, joined by some labour and business groups, said on Tuesday it would go to court to fight a bill aimed at providing universal health coverage, which President Cyril Ramaphosa is set to sign into law on Wednesday.

Ramaphosa has vowed to reform South Africa's two-tier health system, in which a publicly funded sector that serves most of the population is overcrowded and run-down, while some people can access better treatment through private insurance.

The government's National Health Insurance Bill would gradually limit the role of private insurance, create a new public fund to provide access for everyone, and set the fees that private doctors can charge.

Supporters call it a generational change to reverse persistent inequality dating to the apartheid era. But opponents say the plans are inadequately funded, and will limit patient choice, harm the quality of care and drive talented doctors out of the country.

The main opposition Democratic Alliance will challenge the law "all the way to the Constitutional Court," its leader John Steenhuisen said. "Our legal team was briefed months ago already and will file our legal challenge against this devastating legislation without delay."

The bill has the strong support of the South African Medical Association Trade Union representing most public sector doctors, which called it "a monumental shift towards achieving universal health coverage and ensuring that every South African has access to quality healthcare irrespective of their socio-economic status."

But other labour groups have joined the opposition in threatening a legal challenge. Trade union Solidarity said it would start with a legal process "within an hour" of Ramaphosa signing a bill it called "populist, irrational and unaffordable".

The South African Health Professionals Collaboration (SAHPC), which represents 25,000 healthcare workers in the public and private sectors, said it was exploring a legal challenge against a bill that would "reverse, rather than progress, equitable, quality healthcare in South Africa".

Business lobby BUSA said it would consider its options, including lawsuits to fight a measure it called "unworkable, unaffordable, and not in line with the Constitution".

(Reporting by Nqobile Dludla; additional reporting by Nellie Peyton; Editing by Olivia Kumwenda-Mtambo and Peter Graff)

By Nqobile Dludla