German lawmakers have voted to legalize same-sex marriage in a snap vote only days after Chancellor Angela Merkel changed her longstanding position.

Lawmakers voted 393 for legalizing “marriage for everybody” and 226 against with 4 abstentions.

Merkel herself voted against the measure, but paved the way for Friday’s vote after saying Monday that lawmakers could take up the issue as a “question of conscience” — freeing members of her conservative coalition, which has been against same-sex marriage, to individually vote for it.

The legalization vote happened after German Chancellor Angela Merkel said she would allow her conservative lawmakers to follow their conscience in the vote. (Tobias Schwarz/AFP/Getty Images)

Germany has allowed same-sex couples to enter civil partnerships since 2001, but same-sex marriages remain illegal.

All of Merkel’s potential coalition partners after the Sept. 24 election, including the centre-left Social Democrats of her challenger, Martin Schulz, have been calling for same-sex marriage to be legalized.