A federal judge in Michigan has blocked a law that attempted to prevent domestic-partner benefits from being offered to people working in public schools and local governments.

U.S. District Judge David Lawson cited the Equal Protection Clause of the 14th Amendment to the U.S. Constitution as the reason he blocked the law, the San Diego Gay & Lesbian News reported Friday. The decision came just days after the U.S. Supreme Court ruled that the Defense of Marriage Act violated the equal-protection principles embodied in the Fifth Amendment to the Constitution.

“It is hard to argue with a straight face that the primary purpose -- indeed, perhaps the sole purpose -- of the statute is other than to deny health benefits to the same-sex partners of public employees. But that can never be a legitimate governmental purpose,” Lawson said in his opinion.

On Thursday, President Barack Obama hinted his administration might provide federal benefits to gay couples living in states that do not recognize their marriages, the Washington Post reported. He said gay couples should have their marriages defined by the location where they were married and not by the location where they live.

“It’s my personal belief -- but I’m speaking now as a president as opposed to as a lawyer -- that if you’ve been married in Massachusetts and you move someplace else, you’re still married, and that under federal law you should be able to obtain the benefits of any lawfully married couple,” Obama told reporters during a news conference in Dakar, Senegal.