The majority of Danish MPs (75 against 30, with more than 74 absentees) adopted the law commonly referred to as the "burqa ban" on Thursday after weeks-long negotiations.
Full or partial bans have since been passed in Austria, Bulgaria and the southern German state of Bavaria, with the Dutch parliament agreeing a ban in late 2016, pending approval from the country's higher chamber.
The Danish government says the law is not aimed at any religion.
Anyone who forces others to wear garments that cover the face may also be fined or receive jail terms of up to two years.
Justice Minister Pape Poulsen, head of the conservative party in a government backed by the nationalist Danish People's Party, said when the bill was proposed in February: "It is incompatible with the values of the Danish society or the respect for the community to keep the face hidden when meeting each other in the public space".More news: Trump to pardon Dinesh D’Souza
It is not known how many women wear the niqab and burqa in Denmark.
Denmark lawmakers have been mulling over the law since previous year and despite fears of religious freedom, the three-party centre-right minority government, its ally the Danish People's Party and the main opposition Social Democrats had supported the ban in 2017. It comes into effect on August 1.
First-time offenders risk a fine of 1,000 kroner (£120).
Following the Danish vote, Gauri van Gulik, Amnesty International's Europe Director, said: "All women should be free to dress as they please and to wear clothing that expresses their identity or beliefs".
Justice Minister Søren Pape Poulsen has previously stated that Danish police will not forcibly remove veils from women.More news: Mueller's team is 'meddling' in midterm elections
"I don't think there are many who wear the burqa here in Denmark".
"If the intention of this law was to protect women's rights, it fails abjectly".
In 2017, the European court of human rights upheld a Belgian ban on wearing full-face veils in public spaces.
Zainab Ibn Hssain, who lives in Copenhagen and has been wearing the niqab for the past year, told Reuters: "It's not nice".More news: Death toll from Nipah virus rises to 15 in Kerala