People celebrate Germany’s legalization of same-sex marriage in front of the Brandenburg Gate in Berlin on June 30, 2017. Fabrizio Bensch / Reuters

German lawmakers voted Friday to legalize same-sex marriage, just days after Chancellor Angela Merkel unexpectedly dropped her longstanding opposition to the vote taking place.

The landmark decision, which grants same-sex couples full marital rights and the right to adoption, makes Germany the 14th country in Europe to legalize same-sex unions, and the 23rd country worldwide. The bill was approved by the Bundestag, Germany’s lower house of parliament, with 393 votes in favor to 226 votes against, with four abstentions. From there, the law must go to the upper house of parliament for approval, putting it on track to take effect before the end of the year.

Since 2001, Germany has only permitted civil unions for same-sex couples, despite the fact that opinion polls have long shown Germans favoring same-sex legalization (a recent YouGov poll found that two-thirds of Germans support it). Though most of the country’s major parties also support same-sex marriage, the conservatives in Merkel’s ruling Christian Democratic Union (CDU) party previously blocked the issue from coming to a vote.

This changed, however, when Merkel signaled Tuesday that she would soften her stance on the issue after announcing for the first time that her party’s members would be allowed to vote individually, rather than forcing them to vote as a bloc, noting that she “would like to lead the discussion more into a situation where it is a question of conscience rather than something I push through with a majority.” The move was widely regarded as an appeal by Merkel to opposition parties ahead of the country’s general election in September, in which she will seek a fourth term. Several parties—including Merkel’s coalition partners, the Social Democrats (SPD)—said they would make the issue a condition of any future coalition agreement.

While Merkel made the vote on same-sex marriage possible, she ultimately voted against the measure, citing her belief that marriage is between a man and a woman. She added: “I hope that the vote today shows not only the mutual respect for different opinions but that this also leads to more peace and social cohesion.”

Of her CDU party members, 26 percent voted in favor.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.