It's official. The land of patatas bravas is slipping into tyranny. The Vatican, no less, says that Spain is acting like "a totalitarian state" and it wants Roman Catholic civil servants there to break the law, even if it means losing their jobs.

The reason is the social reform programme of the Socialist prime minister, Jose Luis RodrIguez Zapatero, a gangly, sheepish figure who has become an unlikely demon figure among conservative Catholics since he won power last year. Besides relaxing the abortion and divorce laws, he wants to give homosexual couples the right to marry and adopt children. His highly emotive bill, in fact, would give Spain a radical gay rights regime equalled only in the Netherlands.

It seems an unlikely turn of events in "Catholic Spain", where not too long ago the Franco regime - which really was totalitarian - fretted about the corrosive moral effect of Pippi Longstocking. These days, though, hedonism rules. Porn is cheerily displayed on the lower shelves of Spanish newspaper kiosks and Spain's bright young things smoke more spliffs than any of their European counterparts save the French.

The pace of change since the death of the Caudillo in 1975 has been breathtaking, but now Spain is becoming polarised between anything-goes liberalism and conservative Catholicism - a division that has deep roots in Spanish history.

For months, the Catholic Church has accused Zapatero of "secular fundamentalism", and Zapatero's ministers have countered that the bishops' ideas are "moth-eaten" and "reactionary". When the lower house of the Spanish parlia-ment approved the gay marriages bill on 21 April, the Church moved up a gear. From Rome, Cardinal Lopez Trujillo, who holds the Vatican's family portfolio, called on Catholic civil servants to refuse to marry gay couples when the law comes into effect - likely to be late this year.

A week later, several Spanish mayors came forward to indicate that they would indeed refuse to marry gays. A furious Spanish government said this would be dereliction of duty and they would be sacked. Cardinal Lopez declared that such denial of "conscientious objection" would make Spain a "totalitarian state".

The retired Archbishop of Barcelona, Cardinal Carles Gordo, was even blunter. "When civil servants obey the law before their conscience," he told local television, "this leads to Auschwitz."

Inevitably, both sides accuse the other of being antidemocratico. Many Catholics are unhappy at the government's heavy-handed refusal to explain to them exactly what their rights are, and there is a feel- ing that Zapatero is cynically pursuing a "sod-you" line (after all, these people are never going to vote Socialist, are they . . . ?)

Spanish liberals, meanwhile, have reason to suspect the bishops, not least because of the language employed in their declarations. Last autumn, for instance, the bishops' spokesman suggested that the gay marriages bill would be a "virus" in society. Earlier in the year, the bishops blamed Spain's high domestic violence rates on "the sexual revolution", a catch-all that presumably includes women's liberation.

There are also suspicions, on the left, of historical Church bias to the right. While it was to be expected that Pope John Paul II would berate Zapatero for his social policies in a speech to Spanish bishops in January, a comment about water took many by surprise: "Water belongs to all," the late Pope said. "It must not be misappropriated . . . but shared."

It looked like a party-political point. The former conservative government's solution to Spain's water crisis was a plan to siphon off the River Ebro. Ecologists were outraged, and when Zapatero won power he dumped it. The decision was controversial, especially for the drought-hit south-east, but it is a controversy, most agree, that belongs in Madrid, not Rome.

As in most family rows, the ostensible sticking points in this church-state dispute are probably code for events long past - in particular the civil war, with its mix of violent anticlericalism and far- right Catholicism. Behind the rhetoric, these questions smoulder on, never quite expressed in words: who, in those dark nights of the 1930s, lined who up against the wall? Who joined in and who remained silent?