South Africa's highest court has begun hearing a legal challenge to last year's ruling which appeared to recognise same-sex weddings.
South Africa is one of the world's most liberal countries in terms of gay rights
The case has been brought by the home affairs department, which argues that the Supreme Court of Appeal did not have the right to allow gay weddings.
It ruled in favour of a lesbian couple's argument that the current law discriminated against homosexuals.
South Africa's constitution guarantees freedom from discrimination for gays.
Some 200 gay rights activists packed the courtroom, wearing orange and yellow t-shirts with the slogan: "Marriage. Anything less is not equality", reports the AFP news agency.
They want the court to uphold last's year ruling in favour of Marie Fourie and Cecilia Bonthuys.
However, religious and conservative groups want the ruling overturned and the court to define marriage as between a man and a woman.
"We trust that the Constitutional Court will rule in favour of the wishes of the majority of South Africans," said African Christian Democratic Party leader Kenneth Meshoe ahead of the hearing.
Home Affair Minister Nosiviwe Mapisa-Nqakula says the matter should be decided by parliament, not the courts.
South Africa's constitution is seen as one of the world's most liberal in terms of gay rights.
In a previous judgement, the constitutional court ruled that gay couples should be allowed to adopt children.