MONTGOMERY, Alabama -- An Alabama appeals court said today the state's ban on consensual oral and anal sex, aimed at criminalizing homosexual conduct, is unconstitutional.

The Alabama Court of Criminal Appeals issued its unanimous ruling in Williams vs. Alabama, the appeal of a Dallas County man who was convicted of sexual misconduct, though the jury found the homosexual sexual encounter was consensual.

The Alabama Court of Criminal Appeals said today a portion of Alabama's sexual misconduct statute is unconstitutional. It was referring to code section 13A-6-65, which reads in part, "consent is no defense to a prosecution."

The state appeals court noted the legislative commentary for the statute says the consent section "was changed by the legislature to make all homosexual conduct criminal, and consent is no defense."

In its ruling the Alabama court pointed to the U.S. Supreme Court's decision in the 2003 case Lawrence vs. Texas, which found a Texas law barring same sex intimate contact was unconstitutional. The high court said there was no "legitimate state interest which can justify its intrusion into the personal and private life of the individual."

In today's opinion, the Alabama court said no Alabama court had ruled on the state law in light of the Lawrence decision. The law remained on the books.

The appeals court did note the 11th Circuit Court of Appeals looked at the law in a 2003 lawsuit over the statute. That decision pointed out the Alabama attorney general conceded the law is unconstitutional as it applies to consensual "anal and oral sex between unmarried persons."

The Alabama appeals court also rejected a request by the state of Alabama to strike the consent language in the statute and send Williams' case back for a new trial. The court said its job is to interpret the law, and it would not "as the state urges us do on appeal, amend 13A-6-65 (a) (3) ... to make it constitutional."

Williams' conviction was overturned by the court.