THE Scottish Government is facing a historic defeat over laws aimed at cracking down on sectarianism at football matches.

Efforts to repeal the Offensive Behaviour at Football and Threatening Communications (Scotland) Act have been backed in Holyrood after opposition parties lined up to defeat the SNP.

The move marks a significant milestone for James Kelly MSP’s bid to get rid of legislation he branded “a complete failure” and unfair to football fans.

His Bill is thought to be the first attempt to repeal an Act in its entirety since the Scottish Parliament was reconvened in 1999.

Herald View: Why MSPs should back James Kelly's bid to repeal offensive behaviour at football Act

Now it has passed its first full vote in Holyrood, with opposition MSPs backing its “general principles” by 65 votes to 61 – leaving it clear to proceed to greater scrutiny before a final debate and binding vote at some point in the next couple of months.

Mr Kelly said the parliament had “made the clear decision to back the repeal of the Football Act”.

He said: “It is discredited legislation which has failed to make any progress in tackling sectarianism, while at the same time dividing fans and the police.

“It is time for the SNP government to listen to the will of parliament and get behind repeal. Instead of continuing to pursue this broken law, it must work to unify parties, anti-sectarian organisations, faith groups and education leaders, and start taking the problem of sectarianism seriously.

“For too long the SNP has hidden behind the Football Act and pretended it is some sort of silver bullet. It is not.

“It is not tenable for the one party, the governing party, to continue to argue for a law condemned by legal experts, equalities organisations and human rights groups, which is now without the support of parliament. The Football Act has got to go.”

READ MORE: Calls to alter anti-sectarianism bill rather than repeal

Community Safety Minister Annabelle Ewing said the vote was “clearly disappointing” and a “sad day for Scotland” – but added "we must respect the will of parliament".

She said: “It’s important now that all parties build consensus on the next steps required to mitigate the impact of this decision on vulnerable communities.

“This is not just a critical time for minority groups. The vast majority of well-behaved football fans who, through no fault of their own, become targets of vitriol and abuse will also be concerned about the message today’s vote sends to people who wish to threaten, attack and abuse.

“We will explore all options at our disposal to protect people as best we can from hate crime, as well as continue with our education work which is helping to prevent it happening in the first place.”

Ms Ewing earlier insisted the door remained open to possible amendments to the legislation, urging against outright repeal.

Meanwhile, SNP MSP James Dornan said repealing the legislation would be an “error of massive proportions” that would take Scottish football back to the 1970s.

He said: “The vote this evening is deeply concerning, with James Kelly’s repeal bill set to erode the powers our police have to tackle bigotry in order to land a political blow.

“Mr Kelly is a politician doggedly pursuing a self-serving agenda – and now opposition parties have joined him in being deaf to the views of the vast majority of people and stakeholder groups across Scotland.”

He said the Act was backed by a range of organisations – with Stonewall Scotland and Victim Support Scotland both arguing against repeal – and branded Labour’s attempt to scrap it “irresponsible”.

He added: “Mr Kelly should now explain to the public why he wants to effectively give the green light to sectarian and offensive behaviour, and create a potentially serious gap in the law when it comes to prosecuting threatening online behaviour.”

Herald View: Why MSPs should back James Kelly's bid to repeal offensive behaviour at football Act

During a two-and-a-half hour debate at Holyrood, Scottish Labour MSP Neil Findlay insisted the legislation represented “straight-forward class prejudice” by criminalising young, working-class men.

Scottish Conservative shadow justice secretary Liam Kerr said it had been a “misguided and discredited law from the start”, adding: “No-one took it seriously, police officers didn’t like enforcing it, and sheriffs laughed it out of courtrooms."

Campaign group Fans Against Criminalisation said they were “delighted” MSPs had backed repealing the legislation.

The Offensive Behaviour at Football Act was initially passed in 2011, when the SNP enjoyed a majority and needed no support from opposition parties.

It was introduced after Celtic manager Neil Lennon was sent bullets and a parcel bomb in the post.