A judge presiding over a legal challenge to California’s gay marriage ban has asked anti-gay groups to prove how it affects heterosexual marriage.

Gay marriage was legalised in California in 2008 but was banned several months later by the voter initiative Proposition 8.

Two unmarried couples have launched a lawsuit over the ban, claiming it is unconstitutional.

Anti-gay group Protect Marriage, which led support for Prop 8, asked US District Chief Judge Vaughn Walker to throw the case out of court but Walker has refused, meaning the case will go to trial in January.

Lawyer for Protect Marriage, Charles Cooper, argued that the ban was necessary to foster “naturally procreative relationships”.

But Walker said: “What is the harm to the procreation purpose you outlined of allowing same-sex couples to get married?”

In bizarre scenes, Cooper was forced to admit he did not know.

Walker also referred to a recent wedding he had presided over, that of a women in her 80s and a man in her 90s, who he said he did not expect to procreate.

Cooper later cited a study from the Netherlands which found that straight couples were turning toward civil partnerships rather than traditional marriage.

When Walker asked whether adverse effects had been found in children, Cooper was again forced to admit he did not know.

January’s trial will determine whether gays should be provided with constitutional protections in the same way as racial minorities and whether the ban would protect marriage or comprise an act of hate.

Gay rights activists hope it will reach the Supreme Court.

Around 18,000 gay couples wed while gay marriage was legal. Earlier this year, the Supreme Court upheld the ban but ruled that those couples could continue to be legally married.