Chilean lawmakers have approved a bill that would legalize gay civil unions in the south American country.

The Chamber of Deputies passed the measure by a vote of 86 to 23, with two abstentions.

‘This is a law that does not discriminate and it gives protection to all couples and families in the country,’ government spokesperson Alvaro Elizalde said.

The Senate last October approved the legislation first introduced by former President SebastiÃ¡n Piñera in 2011.

The amended bill will now return to the upper house, which is expected to approve the measure before the end of the month.

President Michelle Bachelet said she will sign the bill into law.

Rolando Jiménez, president of the Movement for Homosexual Integration and Liberation, welcomed the vote.

‘We dedicate this day, this moment, to the gay and lesbian families that have suffered a historic burden of misunderstanding and prejudices,’ he said in a statement.

‘Today it will be the state’s turn to strengthen them and protect them on equal terms.’

In December, Deputy Gabriel Silber Romo introduced a bill to legalize gay marriage, which is already recognized in Brazil, Uruguay and Argentina.