Opposition parties teamed up to defeat the Scottish Government by passing Labour MSP James Kelly’s Bill to scrap the Offensive Behaviour at Football and Threatening Communications (Scotland) Act by 62 votes to 60.
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.