Labour leadership frontrunner Jim Murphy has pledged to scrap the controversial Offensive Behaviour at Football Act if he becomes First Minister.

The legislation, passed in 2012, gave police and prosecutors extra powers to crack down on sectarian songs and abuse at football matches.

However, it has met with opposition from fans' groups, who believe they have been singled out unfairly, and some eminent legal figures. Dundee Sheriff Richard Davidson said it was "horribly drafted" and "mince".

Mr Murphy, MP for Eastwood, said: "If I am elected Scottish Labour Party leader and First Minister I will scrap the Football Act right away.

"The law was an attempt to chase headlines rather than actually fix a complex problem. Sectarianism and intolerance goes far beyond 90 minutes on a Saturday or 140 characters in a tweet.

"Instead of fixing the problem, they have created a pointless culture of mistrust between football fans and the police."

He spoke out as MSPs debated sectarianism, although Holyrood later voted by 68 to 50 to reject a Labour call for further scrutiny. The Offensive Behaviour at Football and Threatening Communications (Scotland) Act 2012 was forced through by the SNP Government without support from any other party.

Mr Murphy added: "Sectarianism is a deep rooted and hate filled long-term problem in Scotland. It was allowed to fester and grow over many decades. Shamefully it was celebrated by a minority and silently tolerated by far too many.

"We have come a long way since the 1970s and 80s, but there is still a lot more to do. The way to tackle intolerance and bigotry is every day in our classrooms and communities not with gimmick legislation.

"Only when sectarianism in Scotland is seen by future generations to be just as unacceptable as racism and homophobia will we get rid of this stain on Scottish society for good.

"The Football Act isn't helping us towards the fair and tolerant Scotland we all want to live in. It has to go."

During the debate at Holyrood, Tory justice spokeswoman Margaret Mitchell said: "This is fundamentally bad legislation which was poorly drafted constituting, as it did, a knee jerk response to the something-must-be-done clamour!

"The Act paved the way for the introduction of new criminal offences by statutory instrument, without full and detailed parliamentary scrutiny and despite a distinct lack of consensus amongst key stakeholders. It was trailroaded through by the SNP majority government in the face of opposition from Scottish Conservatives, Labour and the Liberal Democrats who all voted against it."

She added: "Expressions of religious hatred, regardless of how they are articulated, are completely unacceptable in any civilised society. So it is deeply depressing that in Scotland today, sectarian divisions continue in some local communities. This frequently manifests itself as so-called sectarian 'banter' or as terms of abuse, intimidation and harassment which can, at the extreme end of the spectrum, develop into violence.

"As recently as April this year, sectarian tensions once again emerged at the Glasgow Cup Final between the Celtic and Rangers under-17 youth teams...the occasion was virtually hijacked by supporters of both teams, who taunted and derided each other with derogatory comments and songs for the duration of the match.

"So it's little wonder campaigners, such as Nil by Mouth, argue that not enough is being done by the Scottish Government and the football authorities to combat sectarianism.

"However in seeking to tackle the problem it is vitally important that the focus does not become narrowly restricted to football alone but rather seeks to adopt a holistic and consensus-driven approach."