The Texas sodomy law, one of more than a dozen such bans still in existence around the country, made it a crime for people of the same sex to engage in "deviate sexual intercourse."
Justice Anthony Kennedy delivered the majority's opinion, which found that the law "demeans the lives of homosexual persons" and that the men at the center of the case "are entitled to respect for their private lives."
"When homosexual conduct is made criminal by the law of the State, that declaration in and of itself is an invitation to subject homosexual persons to discrimination both in the public and in the private spheres," Kennedy wrote.
Kennedy was joined by Justices John Paul Stevens, Ruth Bader Ginsburg, David Souter, Stephen Breyer and Sandra Day O'Connor, although O'Connor filed her own rationale for overturning the law.
Chief Justice William Rehnquist and Justices Antonin Scalia and Clarence Thomas dissented on the ruling. Scalia took the unusual step of reading his dissent from the bench, saying that the court "has largely signed on to the so-called homosexual agenda."
Responding to the majority's concerns that the law left the door open to widespread discrimination against homosexuals, Scalia wrote, "It is clear from this that the Court has taken sides in the culture war, departing from its role of assuring, as neutral observer, that the democratic rules of engagement are observed."
"Let me be clear that I have nothing against homosexuals, or any other group, promoting their agenda through normal democratic means," Scalia said. "Social perceptions of sexual and other morality change over time, and every group has the right to persuade its fellow citizens that is view of such matters is the best."
In a separate 5-4 vote, the high court also overturned its own 1986 ruling that upheld a similar law in Georgia and that declared that homosexuals have no constitutional right to engage in sodomy in private.
The ruling is seen as a major victory for gay rights activists and effectively overturns similar laws in Alabama, Florida, Idaho, Kansas, Louisiana, Mississippi, Missouri, North Carolina, Oklahoma, South Carolina, Utah and Virginia.
"This is historic," Kate Kendall, executive director of the National Center for Lesbian Rights, told the Associated Press. "There is not a gay person in this country who has not lived their entire life under the yoke of these laws existing somewhere."
But some conservative groups expressed disappointment about the ruling.
"Apparently they have gone the whole route and fully legitimized sodomy in America," Scott Lively, director of the Pro Family Law Center, told the news service. "This is going to have terrible consequences for our nation. In essence, the court has said that states cannot regulate harmful sexual conduct."
Two men who in 1998 were tried and found guilty of "deviant homosexual conduct" under Texas' Homosexual Conduct Law brought the challenge to the high court. The two were jailed overnight and ordered to pay $200 in fines after police, responding to a call from a neighbor claiming that an armed intruder had entered the premises, discovered them having anal sex in their bedroom.
In another highly anticipated ruling, the high court dismissed, on technical grounds, an appeal brought by athletic apparel giant Nike over whether it can be liable for the accuracy of statements made in its public relations campaigns.
The court issued a one-sentence, unsigned order dismissing the case. The decision means that Marc Kasky, a California anti-globalization activist, can continue to pursue a lawsuit he brought against Nike, Inc., charging that it has misled the public on its labor practices.
"This case presents novel First Amendment questions because the speech at issue represents a blending of commercial speech and debate on issues of public importance," Stevens wrote for himself and Justices Souter and Ginsburg in an opinion meant to explain some of the reasoning behind the court's decision.
Justices O'Connor, Kennedy and Breyer went on record saying the court could have resolved the case.
"In sum, I can find no good reason for postponing a decision in this case," Justice Breyer said.
In a third ruling, the Supreme Court ruled 7-2 in favor of a death row inmate, ruling that the man's constitutional rights had been violated when his lawyers failed to conduct an additional investigation of his background that may have contributed to his defense.
In all, the court issued five decisions on Thursday, the final day of its scheduled term that began in October 2002.