Denmark has joined some other European countries in deciding to ban garments that cover the face, including Islamic veils such as the niqab or burqa.
In a 75-30 vote with 74 absentees, Danish MPs approved the law presented by the centre-right governing coalition.
The government says it is not aimed at any religions and does not ban headscarves, turbans or the traditional Jewish skull cap.
However, the law is popularly known as the "Burqa Ban" and is mostly seen as being directed at the dress worn by some conservative Muslim women.
Few Muslim women in Denmark wear full-face veils.
Justice Minister Soeren Pape Poulsen said it will be up to police officers to use their "common sense" when they see people violating the law that comes into force on August 1.
The law allows people to cover their face when there is a "recognisable purpose" like cold weather or complying with other legal requirements, such as using motorcycle helmets under Danish traffic rules.
First-time offenders risk a fine of 1,000 kroner (£120). Repeat offences could trigger fines of up to 10,000 kroner (£1,200) or a jail sentence of up to six months.
Anyone forcing a person to wear garments covering the face by using force or threats can be fined or face up to two years in prison.
Austria, France and Belgium have similar laws.
Amnesty International’s Europe Director Gauri van Gulik said: “All women should be free to dress as they please and to wear clothing that expresses their identity or beliefs. This ban will have a particularly negative impact on Muslim women who choose to wear the niqab or burqa.
“Whilst some specific restrictions on the wearing of full-face veils for the purposes of public safety may be legitimate, this blanket ban is neither necessary nor proportionate and violates the rights to freedom of expression and religion.
“If the intention of this law was to protect women’s rights it fails abjectly. Instead, the law criminalizes women for their choice of clothing and in so doing flies in the face of those freedoms Denmark purports to uphold.”