MEXICO CITY (CBS/AP) — Mexico’s supreme court has ruled it is unconstitutional for Mexican states to bar same-sex marriages.

But the court’s ruling is considered a “jurisprudential thesis” and does not invalidate any state laws, meaning gay couples denied the right to wed would have to turn to the courts individually. Given the ruling, judges and courts would have to approve same-sex marriages.

READ MORE: KPIX Original Report: SF Mission Bay Sidewalks Sinking But City Won't Fix 'Private Property'

The high court ruled that any state law which considers the ultimate purpose of marriage to be “procreation, and or defines (marriage) as celebrated between a man and a woman, is unconstitutional.”

READ MORE: Motorcyclist Airlifted To Hospital After Crash Near Bethel Island

Gay marriage is legal in some parts of Mexico, including Mexico City and the northern state of Coahuila.

The ruling was delivered June 3, but didn’t become known until this week.

MORE NEWS: COVID: Vaccine Deadline Looms For San Jose Police; Mayor Says 85% Officers Vaccinated

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.