Pope Benedict XVI has returned to Rome after ending a visit to Spain with a mass attended by three generations of the Spanish royal family in Valencia.
Hundreds of thousands attended Sunday's mass
The pontiff used the visit to implicitly attack the Socialist government's liberal reforms, including the introduction of same-sex marriage.
Opinion polls suggest they have broad support in an ever more secular Spain.
Earlier the Pope met Spanish Prime Minister Jose Luis Rodriguez Zapatero, who did not attend the mass.
The BBC's David Willey in Valencia says the decision of Jose Luis Rodriguez Zapatero not to attend caused a flutter of mild irritation among the Pope's entourage.
Mr Zapatero met the Pope for talks on Saturday, which government officials - quoted by the Associated Press news agency - described as cordial and without any exchange of criticism.
'Good of the family'
The mass was held at a futuristic museum complex on the outskirts of the city, and attended by an open-air congregation of hundreds of thousands.
It included King Juan Carlos and Queen Sophia, with their three children and seven grandchildren.
Dressed in green and white vestments, Pope Benedict praised the traditional family, founded on "indissoluble marriage between a man and a woman".
He called on "all people of good will" to join with the Church in "promotion of the authentic good of the family in contemporary society".
The pontiff also prayed at the scene of a subway crash which killed 42 people on Monday.
The crash, the worst on the underground in Spanish history, happened when the train entered a station at double its normal speed.
It is only Pope Benedict's third trip abroad since his election 14 months ago.
It comes a year after the Spanish government legalised marriage between homosexuals, sparking a bitter dispute with Spain's Catholic bishops.
It has also liberalised the divorce law and is in the process of ending the special privileges the Roman Catholic Church enjoys.