Earlier this month, Mexico’s Supreme Court upheld Mexico City’s same-sex marriage law as constitutional, but on Tuesday the court extended the legality of those marriages to all 31 states.

So basically, any gay marriage registered in Mexico City has to be honored in all of Mexico. Each state, however, is not required to pass same-sex marriage laws of their own.

The court ruled overwhelmingly in favor of the law — 9 to 2 — which grants fundamental rights to same-sex married couples, such as alimony, inheritance rights and health and pension benefits under the country’s federal social security system, the New York Times reports.

“What’s going to happen to a same-sex couple when they cross the border,” asked Justice Arturo Zaldívar, who voted with the majority. “Does this marriage disappear? They go on vacation and they’re no longer married?”