A federal judge ruled on Thursday that Michigan must recognize 300 same-sex marriages that were performed last March during a brief window when the state's ban on gay marriage was temporarily lifted by a court order.

U.S. District Judge Mark A. Goldsmith declared in his ruling that the couples who wed during "only a few hours" on March 22, 2014 are "lawfully married," reports Bloomberg News. As a result, Michigan officials must recognize the over 300 same-sex marriages that took place that day. The judge, however, put a hold on the decision for three weeks, pending an appeal by the state.

Over 300 same-sex couples in four counties got married the day after a trial judge overturned the state's gay marriage ban on March 21, 2014 based on a voter referendum in 2004. However, an appeals court then suspended the decision, which restored the gay-marriage ban and blocked additional marriages.

"That late Friday-afternoon decision prompted four local county clerks to open their offices the next day, waive the traditional three-day waiting period, and immediately issue marriage licenses,'' Goldsmith wrote.  

Goldsmith added that "the window during which same-sex marriage was lawful in Michigan closed abruptly on Saturday afternoon" when a U.S. Court of Appeals put the ruling on hold.

According to Goldman, those who married "acquired a status that state officials may not ignore, absent some compelling interest."

"In these circumstances, what the state has joined together, it may not put asunder," Goldsmith wrote. "Once a marriage has been solemnized pursuant to a validly issued marriage license, the authorizing state cannot withdraw the status that it has awarded, even if the couples had no right to demand to be married in the first place."

The U.S. Supreme Court is to decide Friday whether it will put Michigan's same-sex marriage case on its calendar, reports The Associated Press..