The bill was a priority of Portugal's recently elected prime minister Jose Socrates who had included the measure in his election portfolio. However, to become law the measure needed the assent of the President.
"I feel I should not contribute to a pointless extension of this debate, which would only serve to deepen the divisions between the Portuguese and divert the attention of politicians away from the grave problems affecting us," Cavaco Silva said.Congratulations! Anyone fancy a trip to Lisbon to celebrate?
He said that, in ratifying the law, he was setting aside "personal convictions."
Elsewhere in Europe, gay marriage is permitted in Belgium, the Netherlands, Spain, Sweden and Norway.
Five U.S. states and the District of Columbia have legalized same-sex marriage, as have Canada and South Africa.
Portugal is nearly 90 percent Catholic. However, only around 2 million of its 10.6 million people describe themselves as practicing Catholics and in recent times Portugal has drifted away from the church's teachings.
The current Socialist government has defied the church before. It passed a law in 2007 allowing abortion. The following year, it introduced a law allowing divorce even if one of the spouses objected. It has argued that the legislation is part of Portugal's "modernization."
The new law removes the previous legal stipulation that marriage is between two people of different sexes.
Portugal's Constitutional Court validated the bill's legality last month.[...]
Portugal lifted a prohibition on homosexuality in the early 1980s. In 2001, it passed a law allowing "civil unions" between same-sex couples, which granted couples certain legal, tax and property rights. However, it did not allow couples to take a partner's name, nor inherit his or her possessions or state pension.