German Chancellor Angela Merkel today voted against a law to legalise same-sex marriage, but was defeated when the bill was passed by a huge majority.

Parliament voted in favour by 393 votes to 226 but the German chancellor maintained her belief the union was the preserve of a man and a woman.

'To me, marriage as defined in the German basic law means the marriage between husband and wife,' she said shortly after the vote.

Gay and lesbian activists waving rainbow flags cheered in joyful celebration of the historic vote as some parliamentarians inside the hall threw confetti in the air.

'Choose Love,' read one banner in the about 100-strong crowd outside Chancellor Angela Merkel's office and near the Reichstag building housing the lower house.

Champagne corks popped and whoops, cheers and whistle blasts went through the crowd braving summer rain as news broke that lawmakers inside the chamber had passed the historic bill.

German Chancellor Angela Merkel has voted against a law to legalise same-sex marriage

Green Party's gay rights activist Volker Beck (left) celebrates the vote in the Reichstag building by throwing confetti in the air

Gay couples were seen kissing outside the Reichstag building to celebrate the historic vote

Among those celebrating from the lesbian, gay, bisexual and transgender (LGBT) community was Soeren Landmann of the 'Marriage for All' initiative.

'I got married one year ago in Scotland because we were not allowed to do it in Germany,' he said. 'I am inconceivably happy that a couple that would like to get married won't have to go abroad for it anymore, and that they can now get married here in a very normal way.'

Merkel pulled a last minute U-turn which freed members of her ruling conservative party to follow their personal conscience, rather than the party line.

Her announcement was condemned by some in her traditionally Catholic conservative party.

But Merkel, who will seek a fourth term in September, said her decision was a personal one.

She added: 'I hope that the vote today not only promotes respect between the different opinions but also brings more social cohesion and peace.'

Though her stance on gay marriage remains, she admitted she had changed her mind on the question of child adoption by same-sex couples, which she long opposed.

Merkel pulled a last minute U-turn which freed members of her ruling conservative party to follow their personal conscience. Pictured: A gay couple celebrates the vote outside parliament

Same sex marriage advocates turned up outside the Reichstag building holding signs that read: 'Germany said yes to equality!'

Merkel's announcement to let her party vote their conscience was condemned by some in her traditionally Catholic conservative party

Merkel, who will seek a fourth term in September, said her decision was a personal one

Supporters of gay rights gathered outside the Chancellery with cake to celebrate a vote at the nearby Bundestag

Thomas Oppermann (left), parliamentary group leader of the social democratic SPD party, and SPD leader and candidate for chancellor Martin Schulz (right) celebrate the vote with cake

Members of the Green Party around Volker Beck (centre) celebrate after the vote on legalising same-sex marriages

SAME SEX MARRIAGE AROUND THE WORLD Aside from Germany, same-sex marriage is legal in 22 countries: Argentina, Belgium, Brazil, Britain, Canada, Colombia, Denmark, Finland, France, Greenland, Iceland, Luxembourg, Mexico, Netherlands, New Zealand, Norway, Portugal, South Africa, Spain, Sweden, Uruguay, United States. In some of these countries including as Mexico and Britain, marriage is only open to same-sex couples in some regions. Northern Ireland is the only part of the United Kingdom where same-sex marriage is not allowed. The first country to legalise same-sex marriage was the Netherlands in 2001. In Africa, where homosexuality is a crime in many countries and can lead to imprisonment or the death penalty, South Africa alone has granted the same access to gay couples. Same-sex marriage legislation came into force there in 2006. There are no countries in Asia that allow same-sex couples to marry, or enter civil unions of any kind. In May, Taiwan's constitutional court ruled that same-sex couples have the right to legally marry, the first such ruling in Asia. Almost one in three adults globally believe people of the same sex should be allowed to marry, a survey of almost 100,000 people in 65 countries showed in 2016. Advertisement

Merkel went on: 'Since then I have thought a lot about the matter of child welfare and have now... come to the conviction that same-sex couples should be able to jointly adopt children.'

Merkel had allowed her conservative party's lawmakers to vote their conscience rather than follow the party line in the vote, which was strongly supported by leftist parties.

Political analysts say the issue will likely have faded from voters' memories by the time the election is upon them.

The vote marks a rare victory for Merkel's Social Democrat (SPD) coalition partners, who are trailing the conservatives in opinion polls.

They had seized on Merkel's surprise comments on Monday to say they would push for an early vote before parliament's summer recess.

Many other European countries, including France, Britain and Spain, have already legalised same-sex marriage

Success in passing the so-called 'marriage for all' amendment could provide a sorely needed boost for the centre-left SPD, Merkel's coalition allies

The law was passed in parliament today but Merkel said she maintained her belief marriage was the preserve of a man and a woman

Success in passing the so-called 'marriage for all' amendment could provide a sorely needed boost for the centre-left SPD, which has seen a short-lived boost in the polls earlier this year evaporate in recent months.

The measure will likely be signed into law by the president some time after July 7.

Many other European countries, including France, Britain and Spain, have already legalised same-sex marriage.