Updated

Speaking out strongly to defend the traditional family and the rights of the unborn, Pope Benedict XVI directly attacked Spanish laws that allow gay marriage, fast-track divorce and easier access to abortions as he dedicated Barcelona's iconic basilica, the Sagrada Familia, on Sunday.

It was the second time in as many days that Benedict had criticized the policies of Spain's Socialist government and called for Europe as a whole to rediscover Christian teachings and apply them to everyday life.

Some 250,000 people came out to cheer the pope and watch as he formally inaugurated Barcelona's newest basilica, an architectural marvel still unfinished after more than 100 years of construction.

Benedict has focused much of his pontificate on trying to fight secular trends in the West such as the legal recognition of same-sex unions. He has visited Spain twice and has a third trip planned next year, an indication he sees this once staunchly Roman Catholic country as a battleground for the future of the faithful in Europe.

During his homily Sunday, Benedict noted that the church of the Sagrada Familia — a soaring, Art Nouveau basilica with sandcastle-like spires — was initially conceived of as a temple to the sacred family of its name, Jesus, Mary and Joseph.

He railed against same-sex marriage and divorce, saying families are built on the "indissoluble love of a man and a woman" who should be provided with financial and social benefits from governments. He criticized policies allowing for abortions, saying "the life of children (must) be defended as sacred and inviolable from the moment of their conception."

Spanish Prime Minister José Luís Rodríguez Zapatero's Socialist government has supported a legislative agenda that has deeply angered the Vatican, allowing gay marriage, quicker divorces and easier abortions.

On Saturday, Benedict blasted such policies, saying today's "aggressive" anti-church, secular movement in Spain was reminiscent of the 1930s, when the church suffered violent persecution as the country lurched from an unstable democracy to civil war.

Before boarding his flight back to Italy on Sunday, Benedict met with the king and queen at the airport and then with Zapatero at a 10-minute, informal and low-key reunion in keeping with their divergent views.

In his homily Sunday, Benedict again called for the West to embrace God and shun secular trends. He said the dedication of the Sagrada Familia church was of great importance "at a time in which man claims to be able to build his life without God, as if God had nothing to say to him."

The Associated Press contributed to this report.