German MPs have voted to legalise gay marriage, days after Chancellor Angela Merkel dropped her opposition vote.
It was a clear majority win on Friday (local time), passing by 393 votes to 226. It will give homosexual couples the same rights as heterosexual couples, including marriage and adoption.
Merkel argued against gay marriage in her 2013 election campaign, on the grounds of children's welfare.
But at a magazine promotion event last week, the chancellor appeared to have had a change of heart, saying she had noted other parties' support for it and would allow a free vote.
The bill is likely to pass through the Bundesrat, Germany's upper house, next week.
More than 20 countries have legalised gay marriage, including in New Zealand in 2013.
In a recent YouGov poll, two-thirds of Germans were in favour of the law change.
Martin Schulz, leader of the Social Democratic Party, tweeted following the vote that "progress is possible".
Gay rights activists in Germany have fought for same-sex marriage to be legalised for years, staging both campaigns as well as protests against current law.