Pope Benedict XVI criticised gay marriage and abortion as "insidious and dangerous threats to the common good" in a speech at Fatima as Portugal prepares to legalise same-sex unions.

The pontiff received a standing ovation from an audience of church and lay social workers when he described abortion as a "tragedy" and said the family was based "on the indissoluble marriage between a man and a woman".

Portugal, long viewed as deeply conservative, is set to legalise gay marriage next week only three years after decriminalising abortion.

The Pope expressed his "deep appreciation" for social and pastoral care workers who "defend life and promote the reconciliation and healing of those harmed by the tragedy of abortion".

"Initiatives aimed at protecting the essential and primary values of life, beginning at conception, and of the family based on the indissoluble marriage between a man and a woman, help to respond to some of today's most insidious and dangerous threats to the common good," he said.