After eight hours of debate, Uruguay's lower house, La Camara de Diputados, on Tuesday approved legalizing marriage for gay and lesbian couples.

About 200 gay rights activists following the debate from the chamber's gallery cheered as the vote was announced. Eighty-one of the eighty-seven lawmakers present voted for the measure.

The proposed reform now goes to the Senate, where it has sufficient support to pass. President Jose Mujican has said he'll sign the bill into law.

The “Marriage Equality Law” seeks to modify some 20 articles of the Civil Code, including whose surname goes first when children are named.

“It's an issue that will generate confusion in a society that has forever taken the father's name,” Deputy Anibal Gloodtdofsky told the AP. “But these changes in society have to be accepted.”

Uruguay currently recognizes gay couples with civil unions. After a couple has lived in a “stable relationship” for 5 years, they may petition the government for the recognition.

If the marriage law is approved, Uruguay would become only the second South American country after Argentina to legalize marriage equality.

(Related: Mexican state Oaxaca to legalize gay marriage.)