Germany looked set on Friday to join more than a dozen other European countries - including the UK and the Republic of Ireland - in allowing gay couples to wed.
The CSU, the Bavaria-based and more conservative sister party of Chancellor Angela Merkel's Christian Democratic Union party, has spoken out firmly against same-sex marriage.
The party's Gerda Hasselfeldt, told ARD television before the vote: "The marriage of man and woman is under special protection because it is fundamentally oriented toward creating new life. This is not the case in homosexual relationships."
The vote was taken in the Bundestag in Berlin during the last session of the German parliament before federal elections in September.
The snap ballot came only days after Mrs Merkel changed her long-held stance on the issue by allowing members of her conservative coalition a free vote on the matter.
The German leader was among 226 politicians to vote against same-sex marriage, while 393 voted for it and four abstained.
Civil partnerships for same-sex couples have been allowed in Germany since 2001 but same-sex marriage has remained illegal.
Political parties including the Social Democrats have been demanding that same-sex marriage be legalised. The Green party and FDP both ruled out working closely with Mrs Merkel after the September vote unless same-sex marriage would be supported in any coalition deal.