A federal judge on Monday ordered Ohio officials to recognize same-sex marriages performed in other states, The Associated Press reports.

U.S. District Court Judge Timothy Black ruled that refusing to recognize the marriages violates the Constitution and is “unenforceable in all circumstances.”

The order does not require officials to perform gay marriages in Ohio, whose voters approved a statewide gay marriage ban in 2004.

“The record before this court ... is staggeringly devoid of any legitimate justification for the state's ongoing arbitrary discrimination on the basis of sexual orientation," Black wrote. 

Ohio officials are expected to appeal the ruling, and Black is reportedly leaning toward imposing a stay on his ruling pending the appeal. Black will make that decision after attorneys present their arguments on the issue by Tuesday. 

The stay, however, wouldn’t apply to four gay couples who filed the lawsuit. Their marriages must be recognized immediately, the AP said. 

If the state’s appeal fails, Black’s order would allow married same-sex couples in Ohio to receive the same benefits as other couples, such as property rights and the right to make medical decisions for their spouse.

Same-sex marriage is legal in 17 states and the District of Columbia. Federal judges have overturned gay marriage bans in Michigan, Oklahoma, Texas, Utah and Virginia.