A sign reading “Marriage for all” stands outside the German Parliament before a session to vote on legalizing same-sex marriages in Berlin on Friday. (Clemens Bilan/European Pressphoto Agency)

Germany on Friday recognized the right of same-sex couples to wed, a major step for gay women and men living in a country split between conservative, Christian customs and new values that have made its cosmopolitan capital a haven for dissident lifestyles.

The German Parliament voted 393 to 226 to modify the country’s civil code, reshaping the institution of marriage with little fanfare but enormous significance as Germany prepares to join much of the Western world in codifying marriage equality. After clearing a path for lawmakers to approve the measure, Chancellor Angela Merkel ultimately opposed it.

“It’s a joyous turning point,” said Volker Beck, who has campaigned for gay rights for decades, as a spokesman for the Lesbian and Gay Federation in Germany before entering Parliament as a member of the Green Party. “Equality and civil rights have been achieved.” 

For some, the surprise was only how long it took in a country often seen as a progressive model for the region. Notable, also, was how quickly the matter moved forward once it was brought up this week. 

At the same time, some conservative lawmakers said constitutional change was required, meaning the debate may not be fully settled. But Heiko Maas, the justice minister, told a public broadcaster this was “not absolutely necessary.”

At issue was a web of dynamics, including Nazi-era repression and the way in which political parties have derived their power from religious groups. Over time, however, church attendance has waned, and polling suggests that a comfortable majority of the public supports same-sex marriage. 

Since 2001, Germany has allowed civil partnerships, which afford many of the same benefits accruing to married couples, with the notable exception of the right to joint adoption. 

Electoral pressures facing Merkel also appeared central, leading some gay Germans to wonder whether they were political instruments for the German leader as she runs for a fourth term in September.

“The result is wonderful, but it makes me a bit angry that the gays are just a voting group to be won,” said Michael Rupp, 31, who works for an IT company. 

Merkel, who has blocked consideration of gay marriage for more than a decade, suddenly set the ball in motion Monday. The daughter of a Protestant pastor, she said at an event sponsored by a women’s magazine that she would like to see the issue considered as a “question of conscience,” freeing members of her center-right Christian Democratic Union (CDU) to vote based on their personal convictions. 

Marriage was becoming a wedge issue, and by easing her resistance, Merkel swept it away from her opponents. The Social Democrats, a center-left group forming part of the chancellor’s governing coalition, had declared future cooperation contingent on same-sex marriage. Smaller parties on whom Merkel might depend should she be reelected in the fall, such as the Greens, said the same. 

The chancellor often has made leftist causes, from wages to nuclear power, her own. In this case, however, she kept the issue at arm’s length. After enabling its consideration, which all but guaranteed passage, she ultimately voted no.

Her rationale was that she had met a lesbian couple looking after eight foster children in her Baltic Sea constituency and that her concerns about adoption had been assuaged. But she said Friday that she had not changed her mind about the fundamental question of marriage.

“For me, marriage in the constitution is marriage between man and woman, and therefore I did not vote in favor of this bill,” she said.

Her personal reservations could ease backlash from the conservative wing of her party and its Bavarian counterpart, the Christian Social Union, which is staunchly Catholic. The German Bishops’ Conference opposed the vote in a statement condemning the “hasty procedure” for overriding the “Christian concept of marriage.” 

“I think Merkel herself was the most surprised by the developments of this week,” said Jens Spahn, a gay member of the CDU. “Of course some colleagues are angry, but in the end, everybody recognizes that the time is ripe for a decision.”

Few realized how quickly the issue would come to a vote, as the Social Democrats rushed to put it on the agenda after Merkel’s offhand remark. Even advocates were taken by surprise.

“At times we didn’t think there could be equality for marriage because of our constitution, which clearly was only intended for opposite-sex couples when it was written in 1949,” said Axel Hochrein, a board member of the Lesbian and Gay Federation in Germany. Parliament seemed the only route.

Protest mounted in the early 1990s. In 1994, a statute criminalizing homosexual acts between men was erased.

Civil partnerships in 2001 were a major step, Hochrein said, followed by decisions of the Federal Constitutional Court granting mostly equivalent privileges over the next 16 years. Meanwhile, discrimination based on sexual orientation was made illegal throughout the country.

The uneasy advancement of gay people in the European Union’s largest country reflects vast social differences within Germany, as well as its tortured past.   

“Berlin and some of the conservative villages in the south of Germany — they exist on different planets,” said Andreas Krass of the Center for Transdisciplinary Gender Studies at Humboldt University in Berlin.

It was in Berlin that the gay rights movement began at the turn of the 20th century, with the founding of the first gay rights organization, said Robert Beachy, author of “Gay Berlin: Birthplace of a Modern Identity.” 

But the capital wasn’t “back in its glory,” he said, until reunification in 1990, as homosexuality was as dangerous in the postwar period as it had been under the reign of the Third Reich. Just last week, Parliament voided convictions under an anti-sodomy law sharpened by the Nazis and then preserved by West Germany.  

Today, Beachy said, Berlin is again a mecca of an experimental form of gay life. But Jens Petersen, a spokesman for an AIDS-prevention organization in Berlin, said there is still work to be done. Some 3,000 new HIV infections are detected annually across Germany, he said, a number that has barely budged over the past several years. 

He said his spirit is not dampened, however. Petersen, who is in a civil partnership, said he plans to formalize his marriage the first day it is possible, which is likely to be Nov. 1.