Some parts of the British LGBT community, such as the organization Out and Proud, have argued that, in Thursday’s Brexit referendum, voters should choose to leave the European Union. They suggest that could be good for LGBT rights, pointing to the limits on LGBT rights in some other E.U. member states, such as Poland, and suggesting that these countries’ domestic politics could somehow threaten British LGBT people. These claims have become part of the rhetoric of the pro-Brexit campaign.

Britain scores among the best countries for recognizing lesbian, gay, bisexual and transgender rights, but this is in part because of its membership in the European Union and the influence of its neighbors. Here is how membership in the bloc has helped consolidate LGBT rights in Britain.

British LGBT politics have always learned from Europe

Throughout the 20th century, British LGBT activists looked to their neighbors in Europe when pushing for change. This isn’t surprising. Sexual minorities have always benefited tremendously from open borders. The common experience of coming out to friends and families can create cross-national solidarity.

Much of the early writing and work through which LGBT people constituted an identity went explicitly beyond the nation state. For example, the letters of affirmation received by Karl Heinrich Ulrichs, the early German activist who published on same-sex desires in the mid-1800s, helped create a kind of informal cross-national community. Similarly, in the early 1900s, activist and sexologist Magnus Hirschfeld undertook research across different European countries and examined how these relations were cross-national.

In the late 1920s, the British novelist Christopher Isherwood left for Berlin. His writings about the sexual openness of Weimar Germany were enormously influential back home. Although the rise of National Socialism extinguished most organized gay groups on the continent, transnational ties multiplied again in the post-war period, largely centering on the Netherlands.

LGBT activists saw the E.U. as a pressure point

As continental European countries confronted their wartime past by deepening cooperation, LGBT activists recognized that European institutions could provide a fruitful venue for their advocacy. These new institutions provided them with a pressure point that they could use to influence reluctant states to address gay rights.

Just like today, countries varied greatly in their attitudes about LGBT recognition. In many countries, domestic movements for LGBT rights were powerless, but a few countries started paving a way forward in some domains of lesbian and gay rights. The differences between countries frustrated activists, but it also led them to envision a role for the E.U. on LGBT rights even before the European Union itself had a social mandate.

British activists fully agreed with this orientation toward Europe. In 1978, they helped found the International Gay Association (the precursor to today International Lesbian, Gay, Bisexual, Trans, and Intersex Association, or ILGA) alongside their European counterparts in Coventry in Britain. The ILGA founders recognized that they could use the new European project to exert influence on reluctant European states that did not want to address gay rights.

The E.U. promoted gay rights in Britain

Europe delivered on the hopes of LGBT activists. Its institutions have actively championed the norm of protecting sexual minorities both rhetorically through various resolutions and reports and directly through court rulings, anti-discrimination directives, and E.U. accession requirements.

This had crucial consequences for Britain. For example, take the European Court of Human Rights (ECHR), which is not an E.U. institution but which plays a key role in Europe (and has also become controversial in Britain because of its rulings on the rights of prisoners and others). In the 1981 case of Dudgeon v. the United Kingdom, the ECHR ruled that same-sex relations should be decriminalized in Northern Ireland. The ECHR’s sister institution, the Council of Europe, became an instrumental player in pushing LGBT rights in the United Kingdom, which was then a laggard. There and in Europe, it ruled on issues as diverse as LGBT freedom of assembly, expression and association; age of consent; partnership benefits and family life; military access; and gender reassignment. In groundbreaking legislation in 2015, the ECHR ruled that Italy must recognize same-sex couples legally.

These are examples from the Council of Europe. But the E.U. (which was then the European Community) also played a key role in the struggle for LGBT rights from a relatively early period. The E.U.’s European Parliament issued the 1984 Squarcialupi Report, making it the LGBT movement’s central partner among the E.U. institutions. The parliament adopted numerous resolutions against discrimination on the basis of sexual orientation, including the pivotal 1994 Roth Report. In 1997, the Treaty of Amsterdam was adopted, which resulted three years later in a directive banning discrimination based on sexual orientation in employment throughout the union.

The E.U. Charter for Fundamental Rights (proclaimed in 2000) became a profoundly important document for the recognition of sexual minorities. The European Court of Justice and the Fundamental Rights Agency, established in 2007, have created new venues in which LGBT activists can seek to defend and extend their rights. For example, a historic 2013 ruling by the European Court of Justice granted asylum to LGBT people seeking refuge in the E.U. Most recently, after the tragic shooting deaths of many Latino and Latina LGBTQ people in Florida, the Council of the European Union voted unanimously to intensify its role in protecting the rights of LGBT people.

LGBT rights are part of the European project

Both proponents and opponents of European integration agree that LGBT rights are now among the values that define the idea of contemporary Europe. LGBT activists in the E.U. member states most resistant to LGBT rights carry the E.U. flag along to pride parades — for good reason. Certainly, the E.U. position on the rights of sexual minorities represents a mix of different positions, in which some states are far ahead of the E.U. But the E.U. has also acted semi-autonomously to put pressure on its member states to adopt LGBT rights.

The fact that almost all E.U. states have recognized some form of same-sex partnerships in a relatively short period of time shows that Europe has helped create a place for LGBT people and rights within its societies. My recent book shows that many tenets of Europeanization — including open borders — have real consequences for both the likelihood of adopting LGBT rights and improving societal attitudes toward homosexuality. Thus despite setbacks and a long road ahead, the E.U. has helped Europe move forward.

An early insight of multinational activists — that “Europe” could be a path to LGBT rights — was farsighted and revolutionary. The E.U. helped the unpopular domestic experiments of small states become a platform on which LGBT rights could become universal and transformative. This platform has transformed the lives of many of the most marginal groups, including those of LGBT people in the United Kingdom, without eroding national sovereignty or identity. Even though many British people are proud of their record on LGBT rights, some forget the struggles that built those rights, and the crucial part that the E.U. and the Council of Europe played in those struggles.

Phillip M. Ayoub is an assistant professor of politics at Drexel University and the author of “When States Come Out: Europe’s Sexual Minorities and the Politics of Visibility” (Cambridge University Press, 2016).