Defying opposition from religious groups and conservative politicians, South Africa’s parliament has voted overwhelmingly in favour of a bill allowing gay marriage.

The South African national assembly passed the landmark Civil Union bill by 230 votes to 41 on Tuesday after majority party the African National Congress instructed all its MPs to support the legislation, BBC News reported.

The law is expected to take effect later this month, making South Africa the fifth country to allow same-sex marriage and the first African nation to do so.

Gay couples can already wed in Belgium, the Netherlands, Canada and Spain.

The Civil Union law would allow for the voluntary union of two persons, which is solemnised and registered by either a marriage or civil union.

Some gay activists expressed disappointment the law would enable officials to refuse to perform same-sex marriage ceremonies if they were against their conscience, religion and belief.

But a representative from gay and lesbian collective the Joint Working Group said the legislation was nonetheless a rejection of previous attempts to render lesbian and gay people as second-class citizens, Associated Press reported.

The reform follows a ruling by South Africa’s highest court last December that blocking same-sex couples from marrying was unconstitutional. The court gave parliament until 1 December this year to change the law.

South Africa’s post-apartheid constitution was the first in the world to explicitly prohibit anti-gay discrimination.

Meantime, Mexico City’s legislature has endorsed a bill recognising same-sex civil unions.

Mexico City is a federal district and the planned law would apply only to residents of the area.

The civil unions would provide couples with similar benefits to those of marriage, such as inheritance and pension rights, Associated Press reported.

© Star Observer 2018 | For the latest in lesbian, gay, bisexual, trans* and intersex (LGBTI) news in Australia, be sure to visit starobserver.com.au daily. You can also read our latest magazines or Join us on our Facebook page and Twitter feed.