Gay rights activists gather in front of the Supreme Court ahead of hearings on gay marriage.Corbis Images

In a long-sought victory for the gay rights movement, the Supreme Court ruled 5-4 today that the Constitution guarantees a nationwide right to same-sex marriage.

The decision is the latest in a series of fast-moving changes in laws and public opinion on the rights of gays and lesbians, including the Court's decision two years ago to strike down a key provision of the Defense of Marriage Act forbidding federal recognition of gay marriages for couples residing in states that recognize their union.

The ruling demonstrates that a person's sexual orientation should not in any way affect how that individual is treated before their peers and, equally importantly, before the law.

Although the gay marriage movement has only hit its stride in the United States in the 21st century, gay men and women have been a part of America since this nation's founding -- and long before that.

An ancient Greek vase depicting nude athletes wrestling.Corbis Images

Western sexual relationships between men and women with members of the same gender trace their roots back to the ancient Greeks.

Known as pederasty, a same-sex relationship between an adult man and a teenage boy was commonplace. Although the relationship is viewed as an kind of rite of passage and an important social institution, a pederastic relationship was one of supposed to be one of mutual love, as opposed to a purely transactional sexual relationship.

In other words, love between two members of the same gender was not only tolerated, but commonly accepted and even appreciated. To describe these men as homosexual, however, can be an effort, as historians have argued, to affix modern labels to a culture that would have had no knowledge of them. A man's sexual relationship with another man wouldn't preclude him from having a sexual relations with a woman or women.

Theodosius ICorbis Images

The introduction and spread of Christianity would change the way in which Western civilization treated homosexual relationships for hundreds of years.

In 390, the Roman emperor Theodosius I -- the last emperor to rule over the eastern and western halves of the divided Roman empire -- issued an edict condemning homosexuality and banning the practice. According to "Homosexuality and Civilization" by Louis Crompton, Theodosius had a very specific political reason for his decree: "Effeminacy will weaken the state and is an affront to Roman tradition."

Theodosius essentially set up the justification for homosexual persecution for centuries to come: People who engaged in homosexual relationship were weak, amoral and even savage.

An Aztec stone carvingCorbis Images

Before Europeans arrived in the Americas, despite the incredible diversity among indigenous peoples of the New World, homosexual relationships were common among the different tribes.

Homosexual relationships have been documented among the Aztec, Maya and others. Even evidence of transgendered individuals has been found among the Crow, Cheyenne, Navajo and more.

Henry VIIICorbis Images

Societies in which men are secluded from women, as was the case with ancient Greece, can create an atmosphere in which same-sex relations are established. When the colonists first arrived to the New World, they came in groups dominated by men.

In an effort to control sexual behavior among its distant subjects, the major European colonial powers -- Great Britain, France and Spain -- enacted laws that made "sodomy," a surprisingly more ill-defined term at the time than a modern reader might assume, illegal and even punishable by death.

In 1533, the first English law passed by Parliament under King Henry VIII to deal with homosexuality made it a capital crime to "commit the detestable and abominable vice of buggery with mankind or beast (PDF)."

The law was repealed and reenacted several times, until its final passage in 1563, where it would remain unchanged until 1861, when the punishment was changed from death to life imprisonment.

An illustration of early American explorers.Corbis Images

These laws, devised by religious leaders in the 1600s, tended to focus on sexual acts between men. Only one dealt with homosexual acts between two women, at least initially. Halfway through the 17th century, additional laws were proposed to further include "offenses" between women within the legal definition of sodomy.

(Although anti-sodomy laws might seem like a relic of our colonial past, in fact, until 2003, when the Supreme Court with Lawrence v. Texas deemed anti-sodomy laws to be unconstitutional, they were actually still on the books in 14 states.)

Though difficult to prove, given that anti-sodomy laws targeting homosexual acts required witnesses and pregnancy could not result from gay sexual relations, a number of colonists were prosecuted.

William Cornish, a sea captain who sexually assaulted another man, was executed in Virginia under anti-sodomy laws in 1624. Additional records show other colonials, particularly sailors, tried and executed for the same charges.

Nearly a quarter-century later, a scandal erupted when two women, Sara Norman and Mary Hammon of Yarmouth, were tried under anti-sodomy laws.

A colonial law book.Library of Congress

As was the case with the ancient Romans, the Puritans and colonialists who concocted anti-sodomy laws had a deeper motivation. As Louis Crompton writes in "Homosexuals and the Death Penalty in Colonial America (PDF):

"(T)he Puritans were anxious that their claims in the New World should not be compromised in God's eyes by failing to punish sexual criminals. In trying to understand 17th-century attitudes toward homosexuals we should not underestimate this primitive sense of terror and communal danger."

In other words, they believed that their failure to enforce publicly God's law, even during people's most private moments, would lead to society's collapse. That argument certainly echoes the most extreme positions of gay marriage opponents today, who believe that the decline of the United States coincides with public acceptance of homosexual lifestyles.

PuritansCorbis Images

Because homosexuals were punished by the civil government, condemned by religious leaders and ostracized by private society, gays and lesbians either hid or denied their inner nature.

Religious leader Michael Wigglesworth wrote a bestseller -- or at least what could be called one at the time -- called "The Day of Doom."

Although Wigglesworth's public writings burned with a religious fever, his private diary entries, written in a secret code, reveal a man alight with a different kind of fire. In his diaries, Wigglesworth confesses a "filthy lust" for his male students.

Despite getting married in 1655, Wigglesworth evidently never got over his feelings, writing: "I feel stirrings and strongly of my former distemper even after the use of marriage -- which makes me exceeding afraid."

Even though Wigglesworth was long studied even after his death, it wasn't until 300 years after he wrote these passages that they would be translated and published.

Alexander HamiltonLibrary of Congress

Because of the treatment of homosexual relationships in the past, interpretations of sexual orientations of certain historical figures can be tricky, even with the evidence left behind of personal correspondence among members of the same sex.

Although not necessarily homosexual, homosocial relationships, in which members of the same sex express an emotional attachment and even romantic feelings for one another, clearly existed, even if sexual relations did not.

Alexander Hamilton is probably the most prominent example of a historic figure engaged in such relationship. During the Revolutionary War, Hamilton became close with higher-ranking officers. Letters to some of correspondents, such as John Laurens, suggest Hamilton might have been more than casual friends with these men.

Hamilton once wrote to Laurens stating, "I wish, my Dear Laurens, it were in my power, by actions rather than words, to convince you that I love you." On another occasion, he wrote, "Like a jealous lover, when I thought you slighted my caresses, my affection was alarmed and my vanity piqued."

Despite being married, Laurens seemed to reciprocate Hamilton's affections, no matter how much the fog of history has clouded how exactly those emotions manifested themselves privately.

An illustration of the brain.Corbis Images

Romantic friendships allowed gay and lesbian couples some measure of cover during the 18th and 19th centuries. Although homosexual relationships were still considered taboo, these friendships were socially acceptable.

Or at least they were until emerging medical investigations, particularly in the field of psychology, delved deeper into nature of same-sex attraction. A general consensus among early practitioners in the field concluded that homosexuality was a disease borne out of a compulsive need to achieve sexual pleasure.

Psychologists are even the ones to coin the term "homosexuality," with the assumption that they will be able to "cure" individuals engaging in same-sex relations of their impediment.

The father of psychology, Sigmund Freud, for his part seemed to eschew such judgments from his interpretations of homosexual behavior, once writing: "Homosexuality is assuredly no advantage, but it is nothing to be ashamed of, no vice, no degradation, it cannot be classified as an illness."

An illustration of 19th century San Francisco.Corbis Images

The rise of the American city in the late-19th and early 20th centuries created for the first time in the United States communities of like-minded homosexuals. Once living in rural settings defined by a family structure, individuals now found themselves on their own in large urban areas with lots of different people.

New York City, Los Angeles and San Francisco were among the earliest cities to have a significant gay populations.

Communication within this community was still hidden, because homosexual relationships themselves were still under the surface of the mainstream. Visual and oral codes communicated membership within the subculture. These signals were eventually picked up, however, and allowed law enforcement to infiltrate gay societies.

Henry GerberCorbis Images

As groups of gays and lesbians began to congregate in cities, however, so too did the desire of this community for recognition and rights codified in the law.

In 1924, the Society for Human Rights in Chicago formed, becoming what was the first gay organization in the United States. Henry Gerber, a Chicago activist, founded the group, and was an early pioneer of the gay rights movement in the United States.

An actress portrays Ma Rainey in a stage play.Corbis Images

Although the early 20th century didn't prove too accomodating for homosexuals in civic life, there is one area where gay expression was finding its footing: the arts.

Plays, poetry, songs and more hinted at a lifestyle hidden beneath the surface of the American cultural landscape. These artists included some of the female jazz and blues singers of the Harlem Renaissance, such as Bessie Smith, Ma Rainey, Jackie Mabley, Josephine Baker and Ethel Waters.

After her arrest in 1925 in Harlem for hosting a lesbian party, Ma Rainey recorded the following as a nod to the arrest: "Went out last night with a crowd of my friends / They must've been women, 'cause I don't like no men."

A snippet of a mural featuring the Mattachine Society and Harry HayCorbis Images

Nearly a quarter-century after the founding of the first gay organization in Chicago, the Mattachine Society, the first gay political group, was founded in Los Angeles by Harry Hay.

The group came about at the beginning of the Cold War, a time when Americans were looking around every corner for an enemy, real or imagined. Homosexuals were targeted, identified and ostracized from their jobs, communities and their families.

Following in the footsteps of his predecessor, President Dwight Eisenhower made being a homosexual a fireable offense from federal positions. By 1955, some 1,200 men and women lost their jobs.

The United States Postal Service (USPS) even aided both public and private government contractors in tracking down homosexuals by "putting tracers on suspected homosexuals' mail in order to gather enough evidence for dismissal and possibly arrest."

Police brutality against homosexuals was also commonplace, as law enforcement raided bars and other establishments frequented by gays or outwardly expressing gay culture.

AIDS awareness activists march in protest.Corbis Images

The late 20th century would mark a turning point in the gay rights movement. The era was marked by confrontation between the gay rights community and local, state and federal government.

First, there were the Stonewall Riots, in which a police raid on a gay and lesbian bar was met with fierce resistance for three days from its patrons and others in the community.

In 1973, activists successfully lobbied the American Psychiatric Association to no longer designate homosexuality as a mental illness.

Finally, and perhaps most significantly, government inaction over the emerging epidemic, which would later be known as the human immunodeficiency virus (HIV) and would devastate the gay community in the 1980s and early 1990s, accelerated the urgency of the legal recognition of the rights of homosexual men and women in America.

An activist waves a rainbow flag made to look like the American flag.Corbis Images

Discrimination against gays, lesbians and other sexual denominations in the United States is still alive and common in the 21st century.

Winning the battle to achieve the right to marry in the United States is by no means the end of the gay rights movement, even if it is a major achievement on an issue that would have seemed entirely lost just a decade ago.