Updated

An appeals court has ruled that an Alabama law criminalizing consensual homosexual conduct is unconstitutional.

The Alabama Court of Criminal Appeals unanimously overturned the state's anti-sodomy law. The judges said it was the first time the law's constitutionality had been addressed since the U.S. Supreme Court overturned a similar Texas law in 2003.

Civil and gay-rights advocates say the ruling is a step in the right direction.

The state attorney general's office brought the case to the appeals court after a prosecutor failed to get a jury to convict a defendant on the felony charge of first-degree sodomy. The jury had convicted the defendant of the lesser, non-felony charge of sexual misconduct.

The Human Rights Campaign says Alabama is one of a dozen states with anti-sodomy laws on the books.