Merkel, who will seek a fourth term in a national election on Sept. 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.
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.
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 some time after July 7.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)