Norbert Lammert, president of the parliament, said 393 lawmakers voted in favour, 226 voted against and four abstained.
The chancellor, Angela Merkel, said she voted against the move because she believed marriage was for a man and a woman. She said the decision for her was a personal one, but she hoped the result would lead to greater social cohesion.
“It was a long, intensive, and for many also emotional discussion, that goes for me personally too, and I’m hopeful not only that there will be respect for either side’s opinions, but that it will also bring about more peace and cohesion in society,” she said.
The election-year bill was pushed by Merkel’s leftist rivals, who pounced on a U-turn she made on Monday in which she softened her stance against gay marriage, a manoeuvre that left many conservative politicians fuming.
The lower house approved the law on Friday, hours before the Bundestag begins its summer recess. Before the vote, gay and lesbian groups cheered the push for marriage equality in Germany, where civil partnerships were legalised in 2001.
“It’s a real recognition, so it warms the heart,” said French engineer Christophe Tetu, 46, who lives in Berlin with his partner Timo Strobel, 51.
“We’re thinking about having a party, getting married and using our new rights to protect our relationship.”
Strobel 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”.
Renate Künast of the Green party, which has pushed for decades for LGBT rights, quipped: “I would advise all registry offices in the country to boost staff numbers.”
The rapid series of events kicked off with an onstage interview Merkel gave 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 wellbeing of the children”, replied that her thinking had shifted since she met a lesbian couple who cared for eight foster children.