Approving a single law governing matrimony for heterosexuals and homosexuals, Uruguay's Senate voted Thursday to legalize gay marriage.

Senators voted 23-8 in favor of the bill, which was passed by the lower house in December. It must now return to the lower chamber of Congress with changes.

If approved, the law would make Uruguay the second nation in Latin America and the 12th in the world to legalize gay marriage. Argentina legalized same-sex marriage in 2010.

"It goes beyond homosexuality, it's about a law where everyone shares the same rights and obligations," said Federico Grana, a lawmaker in the ruling Frente Amplio coalition and a member of the Black Sheep Collective, a gay rights group that presented the bill's first draft.

The bill lets couples, gay or straight, decide whose surname goes first when they name their children. It also clarifies rules for adoption and in-vitro fertilization, and eliminates the words "husband and woman" in marriage contracts, referring instead to the gender-neutral "contracting parties."

"This is an issue of liberty, of people's choice and justice," said Sen. Rafael Michelini.

"Liberty because the state should not meddle in who you should marry; of justice because if you marry abroad with someone of the same sex and later return to Uruguay, your marriage should be recognized."

The Roman Catholic Church opposes the proposal, but the church has little political influence in secular Uruguay, which became the first Latin American country to legalize abortion last year.

President José Mujica has been pushing for liberal-leaning proposals in his mandate and says he plans to sign the marriage bill into law.

Based on reporting by The Associated Press.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino