The parliament voted by 393 to 226 votes in favour of same-sex marriage. Many other European countries, including France, Britain and Spain, have already legalised same-sex marriage.
Germany's parliament voted by a wide margin on Friday to legalise same-sex marriage after Chancellor Angela Merkel did an about-face that freed members of her ruling conservative bloc to follow their personal conscience rather than the party line.
Merkel, who will seek a fourth term in a national election on September 24, told reporters after the landmark decision that she had voted against the measure because she believed that marriage, as defined under German law, was between a man and a woman.
But she said her decision was a personal one, adding that she had become convinced in recent years that same-sex couples should be allowed to adopt children.
"I hope that the vote today not only promotes respect between the different opinions but also brings more social cohesion and peace," Merkel said.
TRT World 's Ira Spitzer has the latest from Berlin.
Ire from Catholic conservative bloc
The parliament voted by 393 votes in favour of same-sex marriage to 226 against.
Many other European countries, including France, Britain and Spain, have already legalised same-sex marriage.
Merkel's announcement on Monday that she would allow lawmakers to vote on same-sex marriage according to their individual conscience drew the ire of some in her traditionally Catholic conservative bloc.
But political analysts say the issue will likely have faded from voters' minds by the time the September election comes around.
Friday's 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.
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 sometime after July 7.