Judging the success of a papal visit is never a scientific exercise. But there are certain criteria: was the Pope listened to, or ignored? Did people turn out? Did the media give it good coverage? Did words and actions go together? Were there moments which made people sit up?
Some visits, however wonderful for those taking part, get obscured by particular stories which dominate the headlines and marginalize the deeper message - -as happened in 2008 when the Pope made comments on the papal plane on Aids and condoms which drowned out any further reporting of the trip.
This time, it was Pope Benedict's comments on the papal plane linking modern-day Spanish secularism and anticlericalism to the 1930s which threatened, for a while to derail the trip. Many on the left reacted furiously, as did secularists in the UK when Pope Benedict's Edinburgh speech lumped together atheism and Nazism. But unlike in the UK, where the furious reaction wasn't taken up by the newspapers, the Madrid daily El Pais, the mouthpiece of the left-liberal establishment, and El Publico, saw it as insult, one that was both historically inaccurate (6,000 priests and religious were killed in the civil war, and countless churches torched) and one-sided (because it failed to acknowledge the Church's errors).
Yet what the Pope in fact said was that Spain saw the birth of "a strong and aggressive secularism such as that of the 1930s" and that "this dispute, this clash between faith and modernity, both very lively, is coming about again in Spain today", before going to call for an "encounter" between faith and secularism to resolve misunderstandings. It was clear that Benedict XVI was referring to the shadows of the past which still hang over the present -- which nobody would dispute.
But whereas in the UK, the Pope's messages and actions made a powerful case against the exclusion of faith from public life by demonstrating that the Church had much to contribute to it, in Spain Benedict XVI didn't manage to persuade the children of the Franco era to reconsider. He made the usual eloquent and passionate argument in favour of the need to reconcile faith and reason, truth and freedom, modernity and morality, in elegant, direct texts, but steered clear of addressing some of the historic causes of that alienation. No doubt, there was only so much he could do in two Masses, and there was more than enough to tackle in the themes of pilgrimage, faith, the Christian origins of Europe, God and beauty, the sanctity of life, and so on. He was there too briefly, it could be argued, to start up a passionate debate about the Church's historical record.
But while it lifted the pros, it didn't shift the antis.
The Church was happy with the turnouts. As happened in the UK, the contemporary European obsession with security has to a large extent killed off the spontaneous crowds of the John Paul II era. Going to the Sagrada Familia, it was extraordinary to see a policeman every two feet stretching for miles down streets which, again for security reasons, the Popemobile sped along at 20 miles an hour. Just as in the UK, the way the Church now organises attendance for the events -- each parish is allocated tickets, and has to organize a coach to be bussed in -- meant that the crowds were far smaller than in the previous pontificate. Hotels in Santiago de Compostela and Barcelona were at 70-80% capacity, more than usual for November, but far lower than in the summer season.
That said, Barcelona managed a highly respectable 250,000 spontaneous turnout -- similar to that which came out for Benedict XVI in London.
The greatest success of the visit was visual -- a display of the power of Catholic liturgy in two of the world's most iconic cathedrals. Few places of worship can match the botafumeiro in Santiago de Compostela, or Gaudi's dazzling modern masterpiece in Barcelona.
The Sagrada Familia liturgy was a rare spectacle followed by millions on television -- one in four Spaniards, estimate today's papers -- assisted by the Catalan television station TV3's spidercam, which swooped and soared through the basilica (from where I was sitting, it was a wonder to behold), giving an angel's eye view.
And in Barcelona, the tone was set by its highly-esteemed daily, La Vanguardia, whose editor -- I was told -- had observed the UK papal trip and learned from it: he knew this was a once-in-a-lifetime, heaven-sent chance to register the city in the consciousness of the world. The newspaper's coverage was respectful, phenomenally detailed, and scornful of what it saw as the petty-mindedness of the protesters.
That left the secularists looking like a powerless, disgruntled minority. An anti-pope protest of 2,000 -- with bizarrely ideological slogans such as "No to the Church and the state" -- and a gay "kiss-in" were made to look bad-tempered and ill-judged.
By leaving Spain, preferring to visit troops in Afghanistan, the prime minister, Jose Luis Rodriguez Zapatero, was also made to look sectarian and un-presidential, giving the main platform to Spain's royal family. By reinforcing stereotypes of socialist anticlerical state versus Catholic monarchy, Zapatero came off looking small-minded in comparison to the Catalan politicians of all stripes who made sure they were in the Sagrada Familia for this historical cultural moment.
As in the UK, this was another success for Vatican diplomats. They squared off the government well in advance, and have lowered the temperature of Church-state conflict over the heads of the Spanish bishops' conference.
But the greatest achievement of the papal visit was to heal the wounds left by Pope John Paul II's visit to Barcelona in 1982, when he made the fatal mistake of addressing Catalans without mentioning their nationality, using the same phrase with which Franco addressed them, as "Barcelonans". That insult -- for which the Madrid bishops were responsible -- has lingered long in the Catalan Church, but has been amply compensated by Pope Benedict's warm words in Catalan, and his frequent mention of "this Catalan land".
Globally, that's not going to make much impact. But it has left Catalonia's 1m Catholics feeling recognized, vindicated and more confident.
In that sense Pope Benedict XVI's Spanish trip, like his UK visit, has been a huge success in encouraging Catholics to step up and be counted.
By reminding Spain of the glories of the Church and its vital place in their nation, he may have gently helped to roll back the secularist tide. To the Catholic world at large, he has shown what it means to preside over an authentically sacred liturgy, in a setting of daring modernity.
In some senses, it's too early to evaluate, because last weekend should be seen as the first part of a two-part visit, the second stage of which takes place next August at World Youth Day in Madrid.
It may be then that the Vatican sees the major opportunity to heal the wounds left by the Civil War -- and put the Church at the centre of that historic reconciliation. If nothing else, this trip has been a perfectly executed curtain-raiser for that massive event.