The Parliament of New Zealand has passed a bill allowing same-sex couples to marry.

On Wednesday, MPs voted in support of New Zealand’s Marriage (Definition of Marriage) Amendment Bill – with a majority of 33.

Seventy seven MPs voted in favour – 44 voted against.

The bill introduces equal marriage for all regardless of sex, sexual orientation or gender identity.

It will now go for royal assent (a formality) before coming into effect within four months of royal assent.

New Zealand is the 13th country in the world to legalise equal marriage.

It is legal in the following countries: Argentina, Belgium, Canada, Denmark, Iceland, Netherlands, New Zealand, Norway, Portugal, South Africa, Spain, Sweden, Uruguay.

Uruguay was the most recent country to introduce the measure this month.

New Zealand has become the second Commonwealth realm, with Elizabeth II as its reigning constitutional monarch, to legalise equal marriage, as Canada legalised equal marriage in 2005.

Before today’s vote, New Zealand Labour MP Louisa Wall, who introduced the legislation, said that the time is right for change.

“Marginalising and discriminating against particular sectors do not benefit society and families,” she said.

“It is a simple choice; do we support discriminatory laws or not? I know I don’t and hopefully that is true of most of the members of this house.”