Updated

Spain's Socialist government on Friday approved a bill to legalize same-sex marriages, putting this predominantly Roman Catholic (search) country on course to become only the third country to recognize gay marriages.

The bill was approved at a Cabinet meeting and is expected to be presented to Parliament (search) in February for debate.

"The right to marry is a right for everyone, without distinction. It cannot be understood as a privilege," Deputy Prime Minister Maria Teresa Fernandez de la Vega told a press conference after the Cabinet meeting. "The recognition of homosexuals' rights eradicates an unjustified discrimination."

Under the bill homosexuals will be allowed to adopt children and couples of the same sex will be able to inherit from one another as well as receive retirement benefits from their working spouses in the same way in which heterosexual married couples do now.

Since taking office in April, Prime Minister Jose Luis Rodriguez Zapatero (search) has vowed to institute deep changes on social issues after eight years of conservative rule. On the day he was confirmed as prime minister, he vowed to Parliament to allow gay marriage and fight discrimination against homosexuals.

Zapatero runs a minority government but is generally supported by two small leftist parties. Gays could be able to start marrying as soon as next year.

Gay advocacy groups are supportive of the new legislation but the influential Catholic church adamantly disagrees. A spokesman of the Spanish Bishops Conference claimed some months ago that allowing gay marriages would be like releasing a virus into Spanish society.

If Parliament passes the legislation, Spain would join Belgium (search) and the Netherlands in legalizing gay marriages.

Sweden and Denmark have "civil union" laws for same-sex couples, which fall short of legalizing gay marriage. However, in both countries the union can be blessed by the Lutheran Church, the state religion in Denmark and the dominant one in Sweden.