California's Supreme Court backed a ban on gay marriage on Tuesday, upholding a proposition defining marriage as between a man and a woman.
However the court says 18,000 marriages last year of same-sex couples are still legal.
The court unexpectedly opened the door to same-sex unions last year but has now bowed to the majority of California voters.
Rallies in several cities across the state followed the ruling.
Around 175 people were arrested during peaceful protests in San Francisco where demonstrators blocked an intersection near the Supreme Court building.
Those arrested were released at the scene.