Lesbian, gay, bisexual, and transgender (LGBT) people in Peru face some legal challenges not experienced by non-LGBT residents. Same-sex sexual activity among consenting adults is legal. However, households headed by same-sex couples are not eligible for the same legal protections available to opposite-sex couples.
 In January 2017, a decree issued by President Pedro Pablo Kuczynski took effect, prohibiting all forms of discrimination and hate crimes on the basis of sexual orientation and gender identity. In a landmark ruling published on 9 January 2017, the 7th Constitutional Court of Lima ruled in favor of recognizing and registering a same-sex marriage, between a Peruvian citizen and a Mexican citizen, performed in Mexico City in 2010. In March 2018, the ruling was reversed by the Supreme Court of Peru on procedural grounds.
 Homosexuality has been used as grounds for separation or divorce. Laws meant to protect "public morals", such as Article 183 of the Penal Code on "obscene exhibitions and publications", have also been used against lesbians and gays. Society's attitude towards homosexuals has generally been hostile and is still heavily influenced by the Catholic Church. In the 1980s, the founding of the organisation Movimiento Homosexual de Lima (MHOL) managed to bring about at least a slight change in the way the media treated homosexuality. Known LGBT persons may face persecution by the public. During the first Lima Pride parade in 2002, most demonstrators wore masks to avoid persecution by the public.
 The Moche civilization (100–700 AD) did not regard homosexuality negatively or bore pejorative attitudes against it. About 40% of Moche ceramics (huacos) depict female and male homosexual relations. Similarly, the Chimú civilization (900-1470 AD) did not view homosexuality negatively, and Chimú ceramics depicting homosexual activity exist to this day. However, many of these ceramics and artefacts were destroyed by the Spanish who viewed them as immoral. The Aymara people regarded homosexuals as supernatural beings and shamans, capable of magic.
 The Inca Empire's perception of homosexuality is unclear and is the subject of ongoing debate. Most modern-day documentation about the Incas stems from the Spanish Inquisition, which introduced Christianity to Peru and South America and regarded homosexuality as sinful. According to certain sources, homosexuality and cross-dressing were tolerated "acts of worship", commonly practised in religious rituals and temples. Quariwarmi were cross-dressing shamans, tasked with performing rituals in honour of Chuqui Chinchay, a jaguar dual-gender god. Effeminate men were called hualmishcu or warminchu by the Incas. Lesbian relationships seem to have been highly regarded by Inca society. Lesbians (known as holjoshta) enjoyed many privileges and could even participate in combats and were given the possibility of maintaining promiscuous relations between themselves.
 Male and female prostitution also existed in the Inca Empire. Prostitutes were known as pampayruna. Female prostitutes were regarded with contempt. Women were not allowed to talk to them, or otherwise they would be publicly shaved, and married men who had sexual relations with them would be punished by having their hands and feet tied and then being judged by their wife's family. Despite this, they seem to have been highly valued by unmarried young men. Male prostitutes, on the other hand, seem to have been treated with certain privileges. They lived in temples with the women and dressed in garments, and were particularly liked by noblemen. This would suggest that homosexuality was practised by Inca nobility. Indeed, Francisco de Toledo and other Spaniards were reportedly "horrified" to find that homosexuality and premarital sex were practised by the Incas upon their arrival in the 16th century. Following the fall of the Inca Empire in 1572, the Spanish introduced the death penalty for sodomy.
 In Peru, consensual same-sex sexual activity has been legal since the enactment of the 1924 Penal Code. From 1836 to 1838, the Bolivian Penal Code, which was imposed by General Andrés de Santa Cruz when the Peru–Bolivian Confederation was established, did not expressly prohibit homosexuality. The first Criminal Code of Peru, approved in 1863, included sodomy as a criminal act. According to article 272, someone committing sodomy would be imprisoned, with the same penalties as imposed on the perpetrators of crimes related to rape and statutory rape.
 The age of consent in Peru has changed several times during recent years, and has been subject to political debate, but today it is fixed at 14, regardless of gender and/or sexual orientation, in accordance with a 2012 decision of the Constitutional Court of Peru.
 On 8 August 2020, the Ministry of Economy and Finance ruled that same-sex partners of health-care workers are eligible to inherit benefits.
 On 26 July 2010, Deputy José Vargas of the ruling party Alianza Popular Revolucionaria Americana announced that he would introduce a bill legalizing civil unions. However, in early 2011, the bill died in the Justice Committee because some of its members believed it would be necessary to change the Constitution in order to approve the law.
 Prior to the 2011 Peruvian general election, two of the presidential candidates, Keiko Fujimori and Alejandro Toledo, expressed their support for civil unions for same-sex couples, but neither of them were elected. The winner of the election, Ollanta Humala, had stated that he opposed legal recognition for same-sex couples. In April 2014, legislator Carlos Bruce received a petition signed by 10,000 people in favor of allowing civil unions for same-sex couples. Bruce, who proposed the change in the law in September 2013, expressed his hope that it would alleviate the discrimination faced by LGBT Peruvians.
 The bill was scheduled to be debated on 7 April in front of the Commission of Justice and Human Rights, but ultimately was postponed until after Easter. In June 2014, a number of bills granting various forms of recognition were discussed in Congress. After the debate, politician Carlos Bruce, who had earlier stated publicly that he was gay, decided that his original civil union bill providing same-sex couples with more comprehensive rights should be voted on separately from the other proposals. More than one bill allowing for the recognition of same-sex relationships was scheduled to be discussed in the following parliamentary session, which began in August, though the debate was eventually postponed once more.
 In mid-December 2014, during the last week of the 2014 legislative year, it was announced that the bill would be the first thing on the Government's agenda in the new parliamentary session, which began in early March 2015. On 10 March, Bruce's civil union bill was rejected on a vote of 7–4 with 2 abstentions and 2 absences in the Justice Committee. One senator called for Congress to reconsider the bill and the motion was scheduled for a vote on 17 March, but the meeting was suspended due to a lack of attendance by senators. Also on the agenda was an alternate proposal called a solidary union which was scheduled for a vote within two weeks, though the meeting never materialised. On 14 April 2015, the bill was officially shelved by the Justice Committee after receiving only two votes in favor of its reconsideration.
 Congressmen Carlos Bruce and Alberto de Belaunde, from the center-right party Peruvians for Change, reintroduced a civil union bill in Congress in late November 2016. The bill bears the signatures of various politicians, namely Gino Costa, Sergio Dávila, Vicente Zeballos, Ana María Choquehuanca, Guido Lombardi, Janet Sánchez Alva, Juan Sheput and Vice President Mercedes Aráoz. President Pedro Pablo Kuczynski announced his support for same-sex civil unions during his presidential campaign.
 On 14 February 2017, a bill legalizing same-sex marriage was introduced in the Peruvian Congress. The bill is sponsored by Indira Huilca, Marisa Glave, Tania Pariona Tarqui, Alberto Quintanilla, Manuel Dammert, Horacio Zeballos, Marco Arana and Edgar Ochoa from the Broad Front and Alberto de Belaunde, Guido Lombardi and Carlos Bruce from the Peruvians for Change. Huilca said that the legislation was not about "creating ad hoc legal recognition" for same-sex couples but to extend equal rights. "Neither more nor less than that." The proposal seeks to alter Article 234 of the Civil Code to define marriage as "the union voluntarily agreed upon by two persons legally able to do so".
 On 16 September 2016, the Registry Tribunal of the National Registry of Identification and Civil Status (RENIEC) ruled in favor of a same-sex couple married abroad, considering that same-sex marriage does not contravene international law and order. The couple, married in Belgium, sought to register property they purchased in the country. However, the public registrar refused. On 3 February, the court determined that the applicable law in this case was Belgian law and not Peruvian law. As such, it ruled that the couple can purchase and register property in Peru. The public registrar again refused, saying that although in this case the marriage had been contracted under Belgian law, this contravened international law and order under treaties signed by Peru. In September, the court ruled that the marriage could not be incompatible with international public order because same-sex marriage is allowed in many countries and again ruled that Peruvian law was not applicable to the case because it is a marriage governed under the laws of Belgium. As a result, same-sex couples who have married in a foreign country will have no problems in registering property they purchased in Peru and have their economic rights recognized.
 In a ruling published on 9 January 2017, the 7th Constitutional Court of Lima ordered the RENIEC to recognize and register the marriage of a same-sex couple, Oscar Ugarteche and Fidel Aroche, who had previously wed in Mexico City. Ugarteche is the founder of the Homosexual Movement of Lima, a Peruvian LGBT advocacy group that was founded in 1982. The court ruled that not recognizing same-sex marriages performed in other countries would be highly discriminatory and contrary to both the Peruvian Constitution and many international provisions. The court found that the only reason upon which the marriage was not recognized was because it was concluded between persons of the same sex, and that argument is not reasonable and objective. Additionally, it cited many international precedents, including Atala Riffo and Daughters v. Chile and Obergefell v. Hodges. RENIEC stated it would appeal the ruling to the Superior Court of Justice of Lima. The Superior Court of Justice dismissed the case in March 2018, because Ugarteche had filed the lawsuit against RENIEC six days too late. The Court did not rule on the merits of the case, however. Ugarteche has announced his intention to appeal to the Constitutional Court. The Court heard the case on 20 June 2018.
 In April 2019, the Eleventh Constitutional Court of the Superior Court of Justice of Lima ordered RENIEC to register the same-sex marriage of Susel Parades and Grace Aljovín, married in 2016 in Miami.
 In April 2019, it was reported that four cases seeking recognition for same-sex marriage in Peru were pending. One of them related to a marriage performed abroad, for which the couple were seeking recognition in Peru through a lawsuit. Another was brought by a Peruvian citizen seeking the right to marry his same-sex partner in Peru from a court in Lima. Nelly Paredes Rojas, a public prosecutor for RENIEC, called on Congress to legalise same-sex marriage.
 On 3 November 2020, the Constitutional Court voted 4–3 to reject Ugarteche's petition to register his marriage with RENIEC.
 In June 2022, the Constitutional Court denied an appeal seeking recognition of same-sex marriages conducted in foreign countries, saying the constitution limits marriage to opposite-sex couples. The Court also indicated that it did not believe the country was beholden to the previous Interamerican Court of Human Rights opinion requiring the country to legalize same-sex marriage on the ground that the court had been politicized.
 After a motion lodged by Costa Rica, the Inter-American Court of Human Rights issued a ruling in favour of same-sex marriage on 9 January 2018, requiring countries signatory to the American Convention on Human Rights to legalise same-sex marriage. On 11 January, the president of the Supreme Court of Peru and chairman of the country's judiciary, Duberlí Rodríguez, stated that Peru should abide by the decision. On 29 January 2018, Housing Minister Carlos Bruce estimated that same-sex marriage will be allowed in Peru within two years, and several former Supreme Court judges and lawmakers, including Indira Huilca, stated that same-sex marriage will soon be legal in Peru, no matter what. The Peruvian Government, however, has yet to issue a formal decision on the matter.
 Article 2.2 of Peru's Constitution stipulates that "every person has the right to equality before the law. No person shall be discriminated against on the basis of origin, race, sex, language, opinion, economic status, or any other distinguishing feature". Sexual orientation and gender identity can be included under "any other distinguishing feature", but are not explicitly mentioned.
 Nevertheless, since May 2004, the Constitutional Procedure Code (Law 28.237) expressly provides that the writ of amparo, a constitutional guarantee to protect people from the threat or violation of the rights recognized in the Constitution, can be used in the case of discrimination based on sexual orientation.
 In July 2013, Congress voted down, 56–27 with 18 abstentions, a bill to amend Peru's hate crime laws to include sexual orientation and gender identity.
 By February 2016, a new Penal Code had been drafted and was pending within the Justice and Human Rights Committee. It would establish explicit protection to LGBT people against discrimination, persecution and incitement to hatred. To break the political deadlock within Congress, a governmental decree (Nº 1323) adding the terms sexual orientation and gender identity to existing hate crime and anti-discrimination laws was published in the country's official gazette, with the new Penal Code coming into effect on 7 January 2017. The decree was issued by recently elected President Pedro Pablo Kuczynski.
 However, in May 2017, the Peruvian Congress voted by 66 votes to 29 to remove these provisions from hate crime and anti-discrimination laws. Members of the largest party in Congress, Popular Force, whose leader narrowly lost to Kuczynksi in the 2016 elections, were joined by members of the Alliance For Progress, to remove the provisions issued in the decree. Nevertheless, President Kuczynski vetoed the removal, and Congress has since failed to override his veto. As of November 2018, according to Articles 46 and 323 of the Penal Code, the decree issued in 2017 outlawing discrimination, incitement to discrimination, and hate crimes based on sexual orientation and gender identity is still in effect.
 In addition to the 2017 decree prohibiting discrimination against LGBT people nationwide, a number of regions and districts have enacted their own anti-discrimination laws covering among others sexual orientation and gender identity. These are Ayacucho, La Libertad, Loreto, Moquegua, San Martín, Tacna and Ucayali, as well as the districts of Alto Selva Alegre, Castilla, Miraflores (Lima), and Pueblo Libre. Others have protections but only on the basis of sexual orientation: Amazonas, Apurímac, Callao, Huancavelica, Huánuco, Ica, Junín and Madre de Dios, as well as the provinces of Cajamarca, Cañete, Cutervo, Lambayeque, Lima, Piura, Santa and Sullana, and the districts of Ancón, Chaclacayo, Characato, Jacobo Hunter, Jesús María, Lince, Majes, Miraflores (Arequipa), Morropón, Pachacamac, Picsi, San Isidro, San Juan de Lurigancho, San Miguel, Saña, Santa Anita, Santa María del Mar, Santiago de Surco and Villa El Salvador.
 Transgender people are allowed to change their name so that it matches their gender identity. In May 2014, the Peruvian Constitutional Court ruled that a transgender woman could not change her gender on her national identity document.
 On 4 November 2016, a bill allowing transgender people to legally change their gender without the need for surgery was introduced in the Peruvian Congress. The bill also seeks to allow transgender people access to passports and other identity documents which match their gender identity. As of March 2021, the Gender Identity Law is pending in the legislature, supported by Congresswomen Rocío Silva Santisteban, Carolina Lizárraga, Mónica Saavedra, and the independent parliamentarian Arlette Contreras.
 On 21 October 2016, the Constitutional Court of Peru reversed its 2014 decision, in which the court had determined that sex could only be biological and chromosomal. In this new ruling, published on 8 November, the court acknowledged that people are not only defined by their biological sex, but one must also take into consideration their psychic and social reality. Therefore, the court now recognizes the right of transgender persons to their gender identity. With this decision, transgender people in Peru may apply for a gender change through a judicial process without the need for sex reassignment surgery. Judges Manuel Miranda Canales, Marianella Ledesma Narváez, Carlos Ramos Núñez and Eloy Espinosa-Saldaña Barrera were part of the majority.
 According to Section 269 of the Military Penal Code of 1988, military and police personnel who engaged in same-sex sexual activity, could be punished with between 60 days to 20 years imprisonment or discharge from the forces. Although being homosexual was not expliticly forbidden, recruiters would routinely reject applicants whom they suspected of being homosexual. On 9 June 2004, the Constitutional Court of Peru ruled that it was a form of unconstitutional discrimination to discharge people who committed homosexual acts from the military, given that equivalent heterosexual acts were allowed.
 In July 2015, in response to a lesbian woman who was turned down from donating blood due to her sexual orientation, the Health Ministry issued a statement condemning the incident and affirming that one's sexual orientation is not an impediment to donate blood.
 Nevertheless, when comedian and playwright Carolina Silva Santisteban applied to donate blood in early 2018, her application was rejected on the basis of her sexual orientation. Theoretically, blood donation rules in Peru do not prevent homosexual applicants from donating, if they are otherwise in good health, though in practice several blood drives have rejected such applicants.
 Peruvian society is generally regarded as hostile to LGBT people. The Roman Catholic Church holds heavy influence in the country. As such, attitudes towards the LGBT community tend to reflect Catholic mores. Nevertheless, attitudes have become more accepting and tolerant, in line with worldwide trends. Recent legislation and court rulings have also granted LGBT people more and more legal rights, such as the right to donate blood, the right for transgender people to change legal gender, the right to serve openly in the military, and the right to be protected from discrimination.
 In May 2015, PlanetRomeo, an LGBT social network, published its first Gay Happiness Index (GHI). Gay men from over 120 countries were asked about how they feel about society's view on homosexuality, how do they experience the way they are treated by other people and how satisfied are they with their lives. Peru was ranked 87th with a GHI score of 24.
 In 2020, the Inter-American Court of Human Rights ruled that Azul Rojas Marín, then living as a gay man, had been tortured in police custody in 2008.
 Annual pride parades are held in Lima, Arequipa, Trujillo, Chiclayo, Iquitos, Piura, Cusco, and Callao. In 2017, Lima's parade attracted record numbers, and was attended by several prominent politicians.
 The 2016 national education curriculum includes information on sexual orientation, sex and gender issues. Sexual orientation is officially described as "an emotional and sexual attraction towards another person. It is not a voluntary choice that a person makes in a moment and then changes it. It is rather the result of a complex interaction of many circumstances throughout life (biological, cognitive and environmental aspects)".
 In August 2010, a poll revealed 8.3% of Peruvians approved of same-sex marriage, with higher percentage amongst people from Lima and younger people.
 According to a Pew Research Center survey, conducted between 13 November and 16 December 2013, 14% of Peruvians supported same-sex marriage, with 81% opposed.
 The 2017 AmericasBarometer showed that 28% of Peruvians supported same-sex marriage.
 A poll by the Instituto de Estudios Peruanos (IEP), carried out between June 2016 and May 2019, indicated that the percentage of Peruvians who opposed same-sex marriage had dropped from 68% to 59%. The IEP poll also found that the percentage of people "at odds" with same-sex unions had also reduced from 51% to 40%.
 According to a June 2019 opinion survey, 49% of Peruvians had a "favourable" opinion towards homosexuals, with 33% having an "unfavourable" opinion and 18% undecided. Women (53%), residents of Lima (53%), 18–24-year-olds (66%) and those who personally knew an openly gay person (85%) said they had a favourable opinion.