The German parliament, or Bundestag, on Friday passed a bill legalizing same-sex marriages in a snap vote that made it onto the agenda before the summer break after a surprise shift by Chancellor Angela Merkel.

The bill passed by 393 to 226, with four abstentions. Merkel herself voted against the bill, although her comments helped bring it about.

However, more than 70 members of Merkel's conservative bloc must have voted in favor of the bill for it to pass.

Merkel later explained her "no" vote by saying that she understood the definition of marriage in the German constitution as referring solely to unions between men and women. She said, however, that she hoped the vote to approve gay marriage would lead to "more social peace."

Although she voted against homosexual marriage, she said that after long reflection she had come to the conclusion that same-sex couples should be able to adopt children, which is something the new bill will legalize.

A 'success for democracy'

Volker Beck of the Green party, who has long advocated legalizing same-sex marriage, called the vote "a success for democracy," citing opinion polls showing that 80 percent of Germans were in favor of allowing homosexual couples to marry and adopt children.

Ahead of the vote, Gerda Hasselfeldt from the CSU, which has vehemently opposed the measure, said heterosexual marriage that could produce children was the basis of society, adding that she could not understand "how people could simply put aside something that went to constitute our state."

Germany's approval of homosexual marriages adds it to the growing list of Western countries that allow such unions. Fourteen European countries have now made gay marriage legal, with the Netherlands leading the way in 2001.

Campaign ploy?

The way was paved for a vote on Monday night when Merkel said she wanted the issue to become one of "conscience," suggesting that she would allow a free vote among her own divided party. Her Social Democrat rival for the role of chancellor, Martin Schulz, pounced on Merkel's comments the next day, advocating an immediate vote in parliament, before September's elections.

The bill was put on the agenda for the last day before the summer break by the center-left Social Democrats (SPD), the Greens and the Left party. Merkel's CDU/CSU bloc had criticized the SPD's move, saying that they had previously agreed not to hold a parliamentary vote on the issue during their coalition.

Schulz was quick to hail the outcome of the vote, saying that marriage for all meant "unity, justice and freedom" for all Germans who love each other, quoting from the German national anthem.

Responses poured in around the country. Bundesliga football club Hertha Berlin sent a clear signal in the capital, hoisting a rainbow flag and posting video footage of the event.

Since 2001 Germany has allowed civil partnerships, but not full marital rights, which would include the possibility to jointly adopt children.

Out-foxed or pragmatic?

Schulz had forced the speedy vote, saying he would "take the chancellor at her word."

However, while some would consider the chancellor and CDU to have been wrong-footed, an alternative theory - that Merkel wanted to remove same-sex marriage as an election issue - has been floated. After all, Monday's comments did appear to be her laying foundations for a vote on the same issue in the next legislative period.

All three potential partners in government with the CDU - the Social Democrats (SPD), Greens and pro-business Free Democrats - had declared same-sex marriage as a red-line demand for entering into any future coalition.

Read also: Opinion: Angela Merkel's calculated change of heart on gay marriage