Declaring that "same-sex love and intimacy are well-documented in human history," a judge has overturned California's ban on homosexual marriage as unconstitutional – in a sweeping victory for gay and lesbian civil rights.

US district judge Vaughn Walker ruled that the ban on gay and lesbian marriage imposed by the Proposition 8 referendum in 2008 – when it was backed by 52% of California's voters – violated the right to equal protection under the US Constitution.

"This is a victory for the American people. It's a victory for our justice system," said Theodore Olson, the former US Solicitor General who made the closing arguments at the trial opposing Proposition 8.

The trial hinged on the civil rights question of whether California's voters had a right under the US Constitution to make a moral judgment by discriminating against sexual orientation.

Supporters erupted in celebration outside the court in San Francisco where the case was heard, as the news of the demise of "Prop Hate" filtered out. But little will change immediately, as the ruling will remain suspended while Proposition 8's backers attempt to have their case heard by the US 9th circuit court of appeals.

Judge Walker's ruling in the case of Perry versus Schwarzenegger witheringly dismissed the arguments put forward by proponents of Proposition 8, saying they failed "to advance any rational basis in singling out gay men and lesbians for denial of a marriage license.

"Indeed, the evidence shows Proposition 8 does nothing more than enshrine in the California constitution the notion that opposite-sex couples are superior to same-sex couples."

In his 136-page-long decision, Walker wrote: "The state does not have an interest in enforcing private moral or religious beliefs without an accompanying secular purpose."

In contrast, Walker's ruling said the opponents of Proposition 8 had "demonstrated by overwhelming evidence" that the ban violated their constitutional rights.

Legal experts said that the scope of Judge Walker's ruling was crucial to its chances of being upheld by the appeals court and the Supreme Court. His decision held that Proposition 8 violated both the US Constitution's equal protection clause, based on sex or sexual orientation, and its due process clause as a restriction on the fundamental right of marriage.

Some conservative commentators have objected that Walker himself is gay, although the 65-year-old judge was first appointed by the first President Bush in 1989.

Gay marriage had been legalised in California in May 2008, after a decision by the state's supreme court. But that ruling was overturned after the California state constitution was amended in November 2008 by the passage of Proposition 8, which declared that "only marriage between a man and a woman is valid or recognised in California".