The head of state's decision to permit the enactment of a bill passed by Parliament in January makes Portugal the sixth European country allowing same-sex couples to wed.
President Anibal Cavaco Silva said in a nationally televised address he regretted that the country's political parties had failed to reach a compromise during days of heated debate in Parliament four months ago.
Vetoing the bill would only send it back to Parliament where lawmakers would overturn his decision, he said, adding that the country needed to focus on overcoming an economic crisis that has increased unemployment and deepened poverty.
The Socialist government's bill was backed by all of Portugal's left-of-center parties, who together have a majority in Parliament. Right-of-center parties opposed the measure and demanded a national referendum.
"Given that fact, 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.
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.
Like neighboring Spain, which introduced same-sex marriages four years ago, previous efforts in Portugal to introduce gay marriage ran into strong resistance from religious groups and conservative lawmakers.
Gay rights advocates have said they will continue to fight for gay couples' parental rights, including adoption, which are not included in the law.
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.
SIC: AP