WASHINGTON -- The Supreme Court struck down a ban on gay sex Thursday, ruling that the law was an unconstitutional violation of privacy.

The 6-3 ruling reverses course from a ruling 17 years ago that states could punish homosexuals for what such laws historically called deviant sex.

Laws forbidding homosexual sex, once universal, now are rare. Those on the books are rarely enforced but underpin other kinds of discrimination, lawyers for two Texas men had argued to the court.

The men "are entitled to respect for their private lives," Kennedy wrote.

"The state cannot demean their existence or control their destiny by making their private sexual conduct a crime," he said.