MSPs have voted by 62 to 60 to pass the Offensive Behaviour at Football and Threatening Communications (Repeal) (Scotland) Bill.
Football supporters applauded from the public gallery as opposition MSPs united to defeat the SNP Government on the issue.
The law will be officially scrapped next month once it reaches Royal Assent.
Labour's James Kelly celebrates as opposition MSPs unite to defeat the government and complete his bid to scrap the Offensive Behaviour at Football Act. Supporters applaud from the public gallery pic.twitter.com/4et9XvlFZQ
— Philip Sim (@BBCPhilipSim) March 15, 2018
Scottish Labour’s James Kelly, who led the political campaign against the Act said it had been “completely discredited” and said he was “delighted” it had been repealed.
Mr Kelly described the Act as “the worst piece of legislation in the history of the Scottish Parliament”.
Community Safety Minister Annabelle Ewing said its repeal was “deeply disappointing and worrying”.
The Act was introduced by the majority SNP government in the last parliament but faced criticism from legal experts, fans’ groups and equalities organisations who have argued it is unworkable and unfairly targets football fans.
“The Football Act has been a failure,” Mr Kelly said.
He added it “has not tackled bigotry, it has been widely criticised by lawyers and human rights groups, and football fans have been treated as second class citizens”.
“The reality is that the legislation brought forward by the government and passed in parliament in December 2011 against the will of every opposition party has not worked,” he said.
MSPs had earlier voted down attempts by Ms Ewing to delay the repeal of the legislation to avoid what she described as “a gap in the law”.
Ms Ewing said: “Repeal of the Offensive Behaviour at Football and Threatening Communications Act, without any attempt whatsoever to put an alternative in place, is a foolhardy move that needlessly exposes vulnerable communities to abuse.
“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 it is better to repeal legislation than either reforming it or replacing it.
“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.”
However Mr Kelly’s Bill – understood to be the first passed at Holyrood with the sole purpose of repealing an Act of the Scottish Parliament – was backed by the Conservatives, Labour, Liberal Democrats and the Greens.
Tory justice spokesman Liam Kerr said the Act treated football fans “as some sort of homogeneous, malevolent, ignorant entity” and the offending behaviour in the Act was covered in laws which existed before it was brought in.
He said: “We have an Act that has added nothing to the legislative landscape, has not achieved what it intended and has actually been counterproductive – redirecting, camouflaging but not stopping offensive behaviours and prejudices.”
Lib Dem justice spokesman Liam McArthur said it was “ineffective, counterproductive and illiberal” and has “done more harm than good” in combating sectarianism.