CONTROVERSIAL legislation aimed at tackling sectarianism at football has been overturned in a historic moment for Scotland.

Onlookers broke into applause as MSPs voted to repeal the Offensive Behaviour at Football Act by a majority of just two.

The move marks the first time an entire Act has been scrapped – with no legislation to replace it – since the Scottish Parliament was reconvened in 1999.

Scottish Labour MSP James Kelly, who has spearheaded efforts to get rid of the law, said he was “delighted” his Bill had led to repeal.

He added: “Since the SNP government used its previous parliamentary majority to force the legislation through, it has been repeatedly criticised by legal experts, fans’ groups and equalities organisations.

“The law was a simplistic attempt to solve a complex problem. Sectarianism is a problem in Scotland that goes back generations. It can’t be solved in 90 minutes on a Saturday. The way to fix it is in classrooms and community groups.

“Now the Football Act has been repealed, I hope all parties can get behind the need to support proper investment in anti-sectarianism initiatives, which have seen their funding cut under the SNP.

“Opposition parties have united to defeat the SNP and repeal the Football Act – it is now essential every party unites to tackle sectarianism at source.”

Fans’ groups were seen applauding and hugging in the public gallery as opposition parties united to defeat the SNP, who were the only party to support keeping the legislation.

The Football Act has faced sustained criticism since it was voted into force by the SNP in 2011, when it still had a majority.

It was the first piece of legislation passed at Holyrood with no cross-party support, and its repeal marks the first major reverse of any SNP legislation since it came into power in 2007.

Criticism has centred on claims the law is badly worded and unnecessary, with no clear definition of what constitutes “offensive behaviour”. Football fans have also argued it treats them like "second class citizens".

Fans Against Criminalisation said they were “delighted” the legislation had been scrapped, adding: “This is a historic victory for football fans.”

Community safety minister Annabelle Ewing called the decision “deeply disappointing and worrying”, labelling it a foolhardy move that will expose vulnerable communities to abuse.

She added: “Sectarianism continues to be a problem in Scottish football, but despite this completely unacceptable behaviour, those opposing the Act continue to bury their heads in the sand asserting that that it is better to repeal legislation than either reforming it or replacing it.

“While some progress has been made, there is still an undeniable problem with behaviour at football, and the recent reports made by match delegates demonstrates more needs to be done.

“This move sends out an appalling signal, suggests that the law is going to be soft on antisocial conduct by bigots and bullies and will compromise the ability of police and prosecutors to charge people for unacceptable behaviour.”

She said the Scottish Government would “respect the will of parliament” but would continue to work towards tackling religious bigotry and prejudice.

The Football Act will be officially scrapped next month, once Mr Kelly’s Bill receives Royal Assent.

The legislation was brought into force following a heated Old Firm showdown in early 2011, which saw a confrontation between Celtic manager Neil Lennon and his Rangers counterpart, Ally McCoist.

“Parcel bombs” and bullets had previously been sent in the post to Mr Lennon, as well as other high-profile fans and players.