Norbert Lammert, president of the parliament, said 393 lawmakers voted to approve the amendment, while 226 voted against and four abstained.
The German legal code was changed to say "marriage is entered into for life by two people of different or the same sex", in the bill that was strongly supported by leftist parties.
The election-year bill was pushed by Chancellor Angela Merkel's leftist rivals who pounced on a U-turn she made Monday - a manoeuvre that left many of her conservative lawmakers fuming.
Related reading

Rainbow flags, bubbly to cheer German gay marriage vote
Gay and lesbian groups have pushed for marriage equality in Germany where so-called civil unions were legalised in 2001.
French engineer Christophe Tetu, 46, who lives in Berlin with his partner, told AFP ahead of the vote:
"It's a real recognition, so it warms the heart. We're thinking about having a party, getting married and using our new rights to protect our relationship," he said.
His partner Timo Strobel, 51, said he too was "overjoyed" the couple would be able to show family and friends "that we are committed to each other, that we will stay together and we will spend our lives together".
The law is unlikely to take effect before the end of 2017.
'Breach of trust'
The rapid series of events that led to the vote kicked off with an on-stage interview Merkel gave Monday to women's magazine Brigitte, in which an audience member asked her: "When can I call my boyfriend my husband if I want to marry him?"
Merkel, who long opposed gay marriage with adoption rights citing "the well-being of the children", replied that her thinking had shifted since she met a lesbian couple who cared for eight foster children.
She said she favoured a vote at an undefined future time when all lawmakers could follow their conscience rather than a party line.
Many read the surprising comments as a move to deny opposition parties of a strong campaign issue before September 24 elections.
Merkel's coalition allies the Social Democrats (SPD), as well as the Greens, far-left Linke and pro-business Free Democrats have all declared a gay marriage law as a red-line demand and precondition for an alliance.
And on Tuesday, after much buzz on social media, SPD chancellor-candidate Martin Schulz took Merkel at her word and broke coalition ranks to call for an immediate vote - a move the CDU slammed as a "breach of trust" after four years of joint rule.
Merkel indignantly labelled the political ambush and hasty rush to vote on such a weighty issue "sad and, above all, totally unnecessary"

Barring an 11th-hour hiccup, Germany's lower house is set to approve the law on Friday. (AAP) Source: AAP
Markus Ulrich of the Lesbian and Gay Federation in Germany said Merkel had long argued against gay marriage "in an emotional way and never with real arguments".
"It's very good that she took some time to better understand the reality of same-sex families and couples, in order to get a better picture of the situation.
"We think it's very good and, even if this is happening only because of the electoral campaign, it doesn't matter."