A federal judge in Mississippi struck down a law that banned adoption by same-sex couples, issuing a preliminary injunction on Thursday according to a court order.

U.S. District Court Judge Daniel P. Jordan III overturned a ban that was enacted in 2000, making Mississippi the last state to be rid of its ban on same-sex couple adoption.

The law was challenged by four same-sex couples back in 2015 who were backed by advocacy groups the Campaign for Southern Equality and the Family Equality Council.

Jordan’s ruling was based on the Supreme Court’s decision that legalized same-sex marriage across the nation last year, entailing same-sex couples’ the right to “marriage related benefits—which includes the right to adopt,” Jordan said in his ruling. Based on the Supreme Court ruling last year, the ban violates the equal protection clause, Jordan maintained, deeming it unconstitutional.

Other states, including Florida, Nebraska, and Michigan, have recently had similar bans overturned that barred same-sex couples from adopting.