The law required pubs and bars to have dancing licenses, and if patrons started spontaneously dancing without one, the owners of the venue could be fined.
While the police pressed to uphold the ban on the basis that dancing creates fights and disorder, a campaign group led by Sweden's Left Party has finally succeeded in persuading parliament to overturn the ban, having gained the support of the cross-party Justice Committee.
Parliament previously voted to uphold the ban despite a previous campaign in March 2015, and in 2012 more than 1,000 dancing demonstrators took to the streets of Stockholm in protest at the law.
Police look on as Swedes dance in the street in celebration at the repeal of the dancing ban.
Leader of the most recent campaign, Left Party politician Rosanna Dinamarca, told The Local last week that the law was unnecessary and hard to enforce, since it is difficult to distinguish between "dancing" and customers simply moving parts of their body to a beat.
Overturning the ban is set to have a great impact on Swedes' freedom of movement; The Local reported that in Stockholm alone there are about 1,100 bars and restaurants. While the majority play some kind of music, only 100 currently have dance permits.