Lesbian, gay, bisexual, transgender, and queer (LGBTQ) people in the U.S. state of Maryland enjoy the same rights as non-LGBTQ people. Maryland's anti-sodomy laws were ruled unconstitutional in 1999 and were officially repealed by the state legislature in 2023. Maryland has had statewide protections against discrimination based on an individual's sexual orientation since 2001 and gender identity since 2014. Legislation to legalize same-sex marriage in Maryland was approved by voters on November 6, 2012, and went into effect on January 1, 2013.

Today, the state of Maryland is regarded as one of the most LGBTQ-friendly states in the country, with a 2022 Public Religion Research Institute showing that 87% of Marylanders support LGBTQ anti-discrimination laws. Additionally, a ban on conversion therapy on minors became effective on October 1, 2018. In October 2020, Montgomery County passed unanimously an ordinance that implemented an LGBTIQ+ bill of rights.

History and legality of same-sex sexual activity Same-sex sexual activity was criminalized in the Province of Maryland. The colonial law in Maryland mandated the death penalty for buggery. In August and September 1642, sodomy was described as a "capital offence" within the colony by the Maryland General Assembly. Previously, in 1638, it had been deemed a felony. In 1776, the Maryland Declaration of Rights incorporated the English common law "along with its sodomy prohibition".Brief Amicus Curiae of the Center for the Original Intent of the Constitution in Support of Respondent at A-15, 11-12, Lawrence v. Texas, 539 U.S. 558 (2003) (No. 02-102). By December 1789, state law still deemed sodomy a felony. The statute passed that year punished sodomy between free men with hard labor, with the possibility of being whipped for any misconduct. The death penalty was proscribed for slaves, though the courts could commute the sentence to 14 years at hard labor. See pages 428 here In January 1810, the penalty for sodomy was changed to 1–10 years' imprisonment and the distinction between slaves and free men was eliminated. The first recorded sodomy case in Maryland, also the first such case in the entire United States, occurred in 1810.

In Davis v. State, the Maryland Court of Appeals upheld, by a vote of 4–1, an indictment that charged Davis with sodomy. In 1847, The Justices’ Practice under the Laws of Maryland; including the Duties of a Constable, a book by John H. B. Latrobe, noted that murders, while committing sodomy and other crimes, was to be deemed a first-degree murder, and that sodomy consisted of "carnal knowledge committed the order of nature" by men with other men, women with other women, or men and women engaging in bestiality. In March 1892, the Maryland General Assembly enacted a law stating that sodomy, and other felonies, may be prosecuted upon order from a Baltimore County Circuit Court. See pages 126 and 127 here and here

During the period before World War I, many cities established so-called vice commissions to investigate reports of "perversion". The state also created a commission which reported in 1915 of cases of fellatio (oral sex), "heterosexual masochism and sadism" and homosexual activity in several cities, notably Baltimore. In April 1916, as a result of the report, the state enacted a new law prohibiting oral sex, whether heterosexual or homosexual, with a penalty of up to 10 years' imprisonment and/or a fine of 1,000 dollars. The law was enacted with the claim it was "necessary for the immediate preservation of the public safety" and that it was "emergency" legislation. It also prohibited any other "unnatural or perverted sexual practice". See page 1294 here A law enacted in April 1920 further defined lewdness as "any unnatural sexual practice".

In Wentz v. State (1930), it was stated that "in cases involving sexual offenses...[including] sodomy [and] indecent liberties", there was an exception to the rule that other offenses other than the one "charged is admissible". In April 1931, a law enacted by the Maryland General Assembly stated all murder committed, or attempt to perpetrate, any sodomy, related crimes, or escape from correctional institutions, shall be charged as "murder in the first degree". In April 1934, in the case of Lutz v. State, Judge T. Scott Offutt spoke for the unanimous Maryland Court of Appeals, arguing that the April 1920 law "is directed to the suppression of sexual vice and perversion practiced for gain[.]" In 1941, there was another sodomy case before the court, in Berger v. State, in which a heterosexual physician was prosecuted for acts of sodomy. In March 1951, a law enacted by the Maryland General Assembly stated that sodomy, and other felonies, were exempted from prosecution upon order from the Prince George's County Circuit Court. Another heterosexual case happened in 1952; in Haley v. State. The Court of Appeals unanimously sustained the state's rights to prosecute heterosexual "unnatural and perverted practices". A challenge to the sodomy case was rejected by the Court of Appeals in 1956 in State v. Black. Numerous more sodomy court cases occurred over the following years. By the 1960s, gay people in Baltimore were prosecuted for the crime of solicitation, while those elsewhere would be charged with the crime of "exposure", or charged with other crimes.

In 1970, a state commission recommended decriminalizing "private homosexual acts of adults", by a vote of 12–2. The commission noted that practices in Maryland included frequent entrapment by "decoy" police, and suicides occasionally occurred from sodomy arrests. Scholar Robert G. Fisher, applying the Kinsey Report statistics to Maryland, estimated that there were 100,000 "practicing male homosexuals" in the state. The Maryland General Assembly did not follow the recommendations of the commission. In 1976, the Senate passed a bill to repeal the sodomy law, but it failed to pass the House, and repeal bills subsequently passed the Senate twice, in 1977 and 1987, but were rejected in the House. A legal challenge to the law on the grounds of privacy violations was rejected by the Court of Appeals in 1980 in Kelly v. State.

All laws against non-commercial, private consensual sex were overturned by Maryland state courts. The decision in Schochet v. State (1990) invalidated laws against private consensual sex between heterosexual adults. The decision was criticized for leaving same-gender couples who practice oral sex or anal sex "vulnerable to prosecution". In October 1998, the decision in Williams v. Glendening by Judge Richard T. Rombro invalidated laws against private consensual oral sex between persons of the same sex. While the judge did not saw that the law violated the Maryland constitution, a subsequent settlement in Williams in 1999 invalidated laws against private consensual anal sex. The settlement was praised by ACLU as the "first deal of its kind" which removed an "outmoded" law. However, some scholars argued that the decision was a victory for privacy rights of Marylanders but "stopped short of completely decriminalizing...sexual intimacy" in the state, called for modifying the Annotated Code of Maryland to ensure the decision is followed, and full decriminalization of sodomy in the state. In 1999, ACLU and Lambda Legal, which had launched efforts to challenge sodomy laws, won a victory in a lower Maryland court, with the Maryland government consenting to the judgement. Lambda had previously participated in the 1994 case, North v. North, in Maryland.

In March 2003, Delegate Maggie McIntosh, majority leader of the Maryland House of Delegates, became Maryland's first legislator to "come out of the closet".Profile, jhunewsletter.com; accessed December 4, 2015. Previously, in November 1980, Robert Bauman, a Maryland U.S. representative, lost re-election to Roy Dyson, after admitting that "homosexual tendencies" and alcoholism caused him to solicit a 16-year-old male prostitute for sexual intercourse. Previously in October 1980, he had been charged for soliciting sex from a prostitute, and had apologized to voters for his indiscretions. He ran for a House seat again in 1982, but withdrew from the race before primary election day. In June 2022, it was reported that various "openly gay and lesbian candidates" were running for election, or seeking re-election, in Montgomery, Prince George's and Howard Counties of Maryland.

On January 30, 2020, Maryland Senate began discussion of a bill, proposed by Sen. Susan Lee, to repeal the unenforceable and unconstitutional sodomy ban. It was approved by the Senate, with amendments, on March 18. The Maryland House of Delegates accepted the amendments the same day. The codified law took effect and was implemented on October 1, 2020. Just immediately before Easter 2023, a bill passed both houses of the Maryland General Assembly to formally repeal the archaic law banning oral sex, which became law without Governor Wes Moore's signature. The law took effect October 1, 2023.

July 2021 police raids In July 2021, several men under police raids within Maryland were arrested for gay sex, but not heterosexual sex, under the Unnatural or Perverted Sexual Practices Act, still on the books. Maryland's General Assembly in 2020 voted to repeal the anal sex law, but the Senate amended the bill to not repeal the oral sex ban, so it was left intact. In June 2022, a bill to repeal the law died in Maryland Senate Judicial Proceedings Committee, but committee chair Senator William C. Smith Jr., and the bill's sponsor State Senator Clarence Lam, said they would take up the issue in 2023. In May 2023, the bill become law without Governor's signature to formally repeal the oral sex ban and went into effect on October 1.

Recognition of same-sex relationships

In 1973, Maryland became the first state to ban civil marriage between persons of the same sex, with the passage of legislation amending the family law statute. In Deane and Polyak v. Conaway in 2006, seventeen Maryland plaintiffs pushed for legal marriage rights, supported by the ACLU.

Since 2008, a limited form of domestic partnership has been available to all unmarried couples at least 18 years of age, who can verify their interdependent relationship through documentation. Legal protections for partners include hospital visitation, end-of-life decisions, and joint property rights. Since 2009, Maryland has provided employee benefits to the same-sex partners of state employees. The state has recognized valid same-sex marriages performed in other states and jurisdictions since 2010.

On March 15, 2011, the Maryland House of Delegates returned a bill to legalize same-sex marriage to the Judiciary Committee, tabling it for the rest of the legislative session, but keeping it alive until January 2012, with opposition from Catholic bishops in the state. In 2012, a same-sex marriage bill was introduced in the Maryland General Assembly. After much debate, the law permitting same-sex marriage, known as the Civil Marriage Protection Act, was approved by the House of Delegates in a 72–67 vote on February 17, 2012, and was approved by the Senate in a 25–22 vote on February 23, 2012. Governor O'Malley signed the law on March 1, 2012.

Same-sex marriage has been legal since January 1, 2013. The law took effect after 52.4% of voters approved Maryland Question 6 in a referendum held on November 6, 2012. The vote was hailed as a watershed moment by gay rights activists and marked the first time marriage rights in the United States were extended to same-sex couples by popular vote. Roman Catholic authorities and African-American religious leaders throughout the state, especially in Prince George's County, had opposed the legislation, saying it would conflict with the best interests of society and threaten religious liberty.

In October 2020, Montgomery County unanimously passed an ordinance that implemented an LGBTIQ+ bill of rights.