VALENCIA, Spain (AP) – Pope Benedict XVI hammered away at traditional family values during a visit to Spain on Saturday, challenging a Socialist government that has angered the Vatican by instituting liberal reforms such as gay marriage and fast-track divorce.

As Prime Minister Jose Luis Rodriguez Zapatero stood nearby, staring straight ahead, Benedict called the family “a unique institution in God’s plan.”

“I wish to set forth the central role, for the church and for society, proper to the family based on marriage,” the German-born pope said, speaking under a canopy protecting him from the blistering Mediterranean sun.

Zapatero was booed by neighborhood residents when he and his wife arrived at the archbishop’s residence for a face-to-face meeting with Benedict.

Spanish government officials, quoted by the national news agency EFE, described the talks as “extraordinarily cordial” and said the pope did not criticize the government. It said they reviewed issues such as “peace, the family, immigration, Europe’s future and, in particular, the situation in Africa.”

The Vatican said it would not issue a statement.

Journalists were barred, but Spanish TV showed a brief broadcast of the two men exchanging gifts.

Zapatero giving Benedict a modern painting, and the pope giving the prime minister a copy of a Vatican codex.

Relations between the government and the Holy See have been strained, and the plans for the meeting, held on the pope’s territory, were confirmed only a few weeks ago.

Benedict was making the third foreign trip of his papacy. He came to Spain for only 26 hours to address an international meeting on the family, an institution the Vatican warns is increasingly threatened by such liberal reforms as gay marriage, which was recently legalized in Spain, as well as in the Netherlands, Belgium and Canada.

Many Spaniards have drifted away from the church in the three decades since the fall of the Gen. Francisco Franco dictatorship, under which it enjoyed special privileges.

Spain has passed from being a bastion of Roman Catholicism to a predominantly lay society in less than a generation. Statistics show that while 80 percent of Spaniards still call themselves Catholics, only 42 percent believe in God and 20 percent go to Mass.

But tens of thousands turned out to greet Benedict when he arrived in Spain’s third-largest city, and organizers expected as many as 1.5 million people to attend Sunday’s papal Mass. The city was festooned with flags and balloons bearing the yellow and white colors of the Vatican.

Benedict, visiting Valencia’s 17th century cathedral, told his bishops he was aware of the secular drift in a country with “deep Christian roots” and urged them to “keep alive and vigorous this spirit, which has accompanied the life of Spaniards throughout their history.”

Benedict addressed gay marriage before even getting off the plane.

“According to human nature, it is man and woman who are made for each other and to give humanity a future,” he told reporters. “The church can’t accept certain things. At the same time, it wants to help people and respect them.”

Zapatero’s government also has made it easier for Spaniards to divorce and halted a plan by a previous, conservative government to make religion classes mandatory in public schools.

Maria Luisa Galdon, a 54-year-old housewife with three daughters, said Spain needs the papal visit because families are in trouble.

“What’s missing is love, understanding and education,” she said.

She believes the pope should give Zapatero a message to improve relations with the church and give it more support.

“I think he will do it politely and necessarily,” Galdon said.

The Vatican seemed irritated that Zapatero was not planning to attend a papal Mass on Sunday.

“The Holy See doesn’t invite leaders to Mass,” papal spokesman Joaquin Navarro-Valls said.

But he noted that such left-wing stalwarts as Fidel Castro of Cuba and former Nicaraguan President Daniel Ortega have attended papal masses.

King Juan Carlos, Queen Sofia as well as Zapatero welcomed the pope on his arrival and a military band played the national anthems of Spain and the Vatican as hundreds of faithful endured sweltering, muggy weather to see the pontiff.

Thousands of police provided security, which included sharpshooters atop buildings and AWACS planes from NATO patrolling the skies.

The pontiff also prayed for 42 people killed in a Valencia subway derailment on Monday – a tragedy that added a tinge of sadness to his first papal visit here.

AP-ES-07-08-06 1506EDT

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.