Peace has broken out in the battle between the Catholic Church and the Scottish Government over attempts to legislate against sectarian-inspired crimes.

But the real war has still to come. At its heart is not religious bigotry but homosexuality.

A revealing insight into the Church’s thinking on this aspect of the Offensive Behaviour At Football And Threatening Communications (Scotland) Bill came last month in a letter to Holyrood’s Justice Committee from John Deighan, of the Catholic Parliamentary Office.

It complained the Bill’s ambition was too broad because it would punish discrimination on the grounds of sexuality, as well as religious abuse.

It would even cover “five forms of transgender identity discriminations”, Deighan said. “This gives rise to concerns that a much wider agenda is being addressed ... than that which is commonly perceived as being limited to football-related sectarianism.

“These provisions, in fact, seem to deepen the embrace of an ideological understanding of human sexuality, which is rejected by the Catholic Church and is contrary to natural law.”

Philip Tartaglia, the Bishop of Paisley, has made some interesting statements about the gay marriage consultation. In September, he asserted “governments do not have the authority to say what marriage is or to change its nature”.

In fact, governments in the UK and elsewhere have frequently defined what marriage is or is not. For example, in 19th-century Britain marriage encompassed the union of a 14-year-old boy and a 12-year-old girl, with parental consent.

It was not until 1929 that Westminster finally raised the age limit to 16 for both sexes.

Neverthless, the Catholic Church’s position on marriage is a headache for Salmond, who has spent years assiduously courting the Church in the hope of pinching its traditional Labour-supporting membership.

Last week the First Minister found himself under a triple-pronged attack from Bishop Tartaglia, who is tipped to succeed Cardinal Keith O’Brien as the next leader of the Catholic Church in Scotland.

The Bishop is no mean politician himself. Heavily involved in last year’s papal visit, in recent months he has spearheaded the attacks on the Scottish Government’s consultation on gay marriage.

In the run-up to this year’s Holyrood elections, Salmond made clear he was in favour of gay marriage, but would not impose it on any church. It’s a stance shared by most of the parties at Holyrood. Prime Minister David Cameron took the same line at the Tory conference last week.

With public opinion polls showing 60% support for same-sex unions in church, it seemed the Bishop was on the losing side.

That was before the Scottish Government’s rushed response to last season’s Old Firm trouble provided a means to ramp up the pressure.

The Offensive Behaviour At Football And Threatening Communications (Scotland) Bill was supposed to hurtle through Holyrood in a fortnight before the summer, legislating for new crimes of offensive behaviour in and around football matches, and on the internet. But the First Minister had to delay it six months because of concerns about lack of scrutiny. Since then, academics, religious groups, football clubs, fans and MSPs have done that scrutiny, and their opinion of the Bill has sunk lower and lower.

There are fears it is so broadly drafted it will curb freedom of speech and single out football fans for special punishment.

The definition of sectarianism is also unclear. The minister in charge, Roseanna Cunningham, caused consternation by claiming the sign of the cross or singing Rule Britannia could be construed as sectarian in certain contexts.

A fortnight ago, the Scottish Tories’ leader, Annabel Goldie, warned Salmond at First Minister’s Questions that support for the Bill was slipping away.

The turmoil provide Tartaglia with an open goal.

On Tuesday, the Bishop sent Salmond a letter yoking together the anti-sectarianism Bill with the gay marriage consultation. He also revived a longstanding complaint that the SNP had failed to publish years of statistics on the prosecution of “religiously aggravated offences”, which would show Catholics are the victims in two-thirds of sectarian cases.

The big picture, Bishop Tartaglia implied, was that the SNP was losing touch with Catholics. The same Catholics, he might have added, who helped give Salmond his majority in May, by voting more for the SNP than Labour for the first time – the same Catholics who could return to Labour or vote No in an independence referendum.

Some in the SNP are now asking why the First Minister and colleagues did not see it coming.

“They seem shocked and surprised by what happened,” said one senior party source. “It’s like they don’t quite get it. They didn’t understand the politics of the Catholic Church.

“This guy is moving up to being a cardinal. It’s almost as if he’s making a power play and, unfortunately, we are getting caught up in it.”

Professor Tom Devine, one of Scotland’s most eminent historians, said some Church leaders felt a growing distance with the SNP.

The change was recent, given Salmond and the Government had helped during the papal visit, and Salmond himself is a robust advocate of denominational schools.

“It is definitely not as warm a relationship as before. So I think there must be a degree of hurt if they are prepared to come out and say this sort of thing.”

Tartaglia’s letter began with gay marriage, reminding Salmond of the Church’s “serious misgivings about plans to dismantle the definition of marriage in Scotland”.

It was this issue, Tartaglia said, which could “bring about a serious chill” between the Scottish Government and the Catholic Bishops’ Conference.

Having set the finger-wagging tone, Tartaglia then leapt into the Offensive Behaviour Bill.

It showed “an indecently hasty desire to enact legislation”, yet ministers were refusing to quantify the extent of the problem by not releasing those prosecution statistics.

Taken together, the Bishop detected a “growing apprehension and disappointment on the part of many in the Catholic community at the direction your government is taking”.

The threat was unmissable: force through either gay marriage or the anti-sectarian Bill and you will lose votes.

And not just votes at election time, but in a referendum too. A reference to Catholics losing faith in the Government just as it was working towards “an independent Scotland” made that clear.

Within hours of the letter arriving, Salmond was on the phone arranging Friday’s sitdown.

After the hour-long event, the Bishop emerged smiling. Grateful for being able to raise his concerns “in a personal way”, he said fears about the Offensive Behaviour Bill impacting on free speech – which crucially includes the right of faiths to run each other down – were being addressed.

He even glossed over the revelation that years of data on religious aggravation had been destroyed in Crown Office housekeeping.

Asked if there was now a truce, the Bishop said: “More than a truce, possibly. We were very satisfied with the reassurances we were given about the Offensive Behaviour Bill.”

But gay marriage remained the “real issue”, he added. “This matter remains unresolved for the moment since the consultation is ongoing. I thank the First Minister for his assurance the Government has not reached a final decision on this issue.”

To rub it in, the Church later announced it would step up its campaign “in defence of marriage”.

The Bishop’s gay marriage crusade had been flagging, but after using the anti-sectarian Bill to batter down the doors to Bute House, it was suddenly in the headlines again.

It had also been a valuable exercise in power. The Church shouted, the Government jumped.

The gay marriage debate will rumble on until it is decided in a free vote of MSPs. Defending gay marriage at the Scottish LibDem conference yesterday, leader Willie Rennie attacked the Bishop’s threat ‘to invoke some sort of block vote [as] an affront to liberal democracy’.

He said: “Challenging an organisation with 800,000 followers may seem difficult, but we are prepared to be awkward to stand up for what we believe to be right.”

Salmond’s dilemma is whether to placate the Church by dropping or rewriting the football Bill, or to persevere with it to save face.

According to John Curtice, professor of politics at Strathclyde University, it is a myth the Catholic Church can deliver or deny a block vote among its members, and has been for decades.

Indeed, the Church can’t even persuade its own flock to oppose gay marriage, with the latest survey showing 55% of Catholics open to the idea.

Even if the Bishop could sway votes, with all the other main parties in favour of consulting on gay marriage as well, where would they go?

The threat to Salmond comes not from the Church per se, Curtice says, but from the damage the adverse publicity does to the SNP’s key electoral asset: its reputation for competence.

“The danger is not the church. It is if people see the Bill is not going to work and that becomes the story. Then there is a danger electorally.”