The ban, which aims to prevent people from “disguising all or part of their face so as to make it more difficult to be identified”, will come into force on March 1st.
Anyone violating the ban will face up to six months in jail, according to the interior ministry, which first proposed the draft legislation last June.
Exceptions will be made for “people who cover their face for religious reasons” or for people wearing masks in the course of their duties, for example firefighters or police, according to the law as approved by parliament.
When it was first proposed, the draft legislation sparked uproar with police saying it would cause more confusion than clarification.
“We think it will be complicated for spectators to know where the line is between what is allowed and what is not,” national police legal director Lars Tonneman said at the time.
“It will make it pointlessly difficult for police on the ground to decide when a masked face is due to religious conviction or when the person is using it as a false pretext,” he said.
He said there were rarely “women in burqas in sporting venues”.
However, when Sweden’s centre-left coalition government introduced the proposal last year, the CEO of the Swedish Football League told The Local that he did not consider identifying the purpose of wearing a mask at a football match to be particularly difficult.
“There has never previously been a problem in identifying the difference between someone who has religious reasons to cover their face and someone who is doing so with the intent of committing criminal acts. In practice it is very clear what the purpose is,” Mats Enquist said at the time.
Swedish police regularly have to deal with violence between rival gangs of hooligans in or near football stadiums.
In 2014, a supporter of the Djurgården football club died as a result of injuries sustained when he was attacked in the street by a supporter of Helsingborg.