Parliamentarians, including German Chancellor Angela Merkel, prepare to vote at the Bundestag on a new law to legalize same-sex marriage in Germany on Friday, in Berlin. (Sean Gallup/Getty Images)

Friday's parliamentary vote in Berlin to recognize the right of same-sex couples to wed was a long-awaited victory for German liberals. But the vote was a defeat for the woman who seemed to have emerged as one of the country's most popular icons of liberalism: German Chancellor Angela Merkel.

She welcomed over 1 million refugees, abandoned nuclear energy over safety fears and has urged President Trump to respect human rights.

On Friday, however, Merkel voted against same-sex marriage, despite having paved the way to its recognition only days earlier.

The anti-marriage-equality party line of Merkel's Christian Democratic Union (CDU) had long prevented the law from being passed. But on Monday, the German chancellor cleared the way for the issue to win approval in the German Parliament by allowing lawmakers to choose according to their personal convictions after being pressured into a vote by the Social Democratic Party. “I would like to steer the discussion more toward the situation that it will be a question of conscience instead of me forcing something through by means of a majority vote,” Merkel said earlier this week.

German lawmakers vote by a wide margin to legalize gay marriage, although German Chancellor Angela Merkel said she had voted against it. (Reuters)

What she did not say at the time was that she would oppose the law. Merkel's Friday vote against marriage equality may have come as a surprise to international observers who consider her an increasingly influential liberal icon or even “leader of the free world.” At home in Germany, not everyone was equally surprised.

Her seemingly inconsequential vote encapsulates some of the opposing forces tugging at Merkel, said Robert Beachy, the author of “Gay Berlin: Birthplace of a Modern Identity.” She is at once an exponent of a liberal Western vision and the leader of a country, and party, tied to more conservative values.

“It occurs to me that Merkel is feeling increasingly exposed because she certainly wants to align herself with a progressive E.U. culture and tradition, and she’s in some ways the leader of that now,” Beachy said. “It made the absence of same-sex marriage in Germany that much more glaring.”

The daughter of a Protestant pastor, Merkel has long sided with the right of her party on the issue. In 2015, the chancellor said: “For me, personally, marriage is a man and a woman living together.” She repeated those comments almost word for word Friday. What has since changed, however, is Merkel's stance on the right of same-sex couples to adopt children, which she now appears to be in favor of.

Her ambiguity on the issue fits a common pattern that has shaped much of her 12 years as German chancellor: Merkel hardly defines her role in an ideological sense. As chancellor, Merkel has repeatedly turned her back on herself and her own party when she deemed it necessary to adjust to the political winds.

On other subjects, her party and supporters have willingly followed suit. In contrast, same-sex marriage has proved to be a more difficult challenge for the chancellor, as many members of her party remain staunchly opposed to it even as most Germans support marriage equality.

German Chancellor Angela Merkel leads the weekly Cabinet meeting of her government at the chancellery in Berlin. (Markus Schreiber/AP)

Since 2001, Germany has allowed same-sex couples to register civil partnerships, which afford some but not all of the benefits accruing to married couples. Unlike in other Western European nations, such as France or Spain, same-sex marriage remained a red line for many Christian conservatives.

That red line would have been challenged sooner rather than later. All major parties Merkel's CDU could form a coalition with after the general elections in September are in favor of same-sex marriage. From a tactical perspective, there was no way around marriage equality.

By allowing the law to pass before the elections despite opposing it, Merkel appealed to the majority of voters but might have avoided the anger of much of her party — following Merkel's long-standing rationale of trying to make the least enemies whenever possible. “I hope that with today’s vote not only that mutual respect is there between the individual positions, but also that a piece of social peace and togetherness could be created,” Merkel said after the Friday vote.

She likely knew that her personal opposition would matter to her party but not make a difference overall, given that the German parliament voted 393-226 in favor of modifying the country’s civil code.

Isaac Stanley-Becker contributed from Berlin.

Read more:

Germany’s far right preaches traditional values. Can a lesbian mother be its new voice?

The state of gay rights around the world