About 51.21 percent of voters supported the controversial proposal to ban 'full facial coverings' in public, while 50.8 percent were against it, the official results showed.
Swiss voters on Sunday have narrowly backed a ban on full face coverings in public places, a decision has been hailed by supporters as a move against extremists but branded sexist and racist by opponents.
Official results showed that 51.21 percent of voters, and a majority of federal Switzerland's cantons, supported the proposal.
Some 1,426,992 voters were in favour of the ban, while 1,359,621 were against, on a 50.8 percent turnout.
The so-called anti-burqa vote comes after years of debate in Switzerland following similar bans in other European countries, and in some Muslim-majority states, despite Muslim women in full-face veils being an exceptionally rare sight in Swiss streets.
Even though the proposal "Yes to a ban on full facial coverings" did not mention the burqa or the niqab, which leaves only the eyes uncovered, there was no doubt as to what the debate was about.
The Swiss government opposes the measure and says that people covering their faces is a "marginal" issue.
It argues the measure could harm tourism - most Muslim women who wear such veils in Switzerland are visitors from well-heeled Persian Gulf states, who are often drawn to bucolic Swiss lakeside cities. The government also says it wouldn't help the women affected.
Instead, the government backs legislation requiring people to show their faces if requested to do so by authorities.
Ban comes amid mandatory face masks
Campaign posters reading "Stop radical Islam!" and "Stop extremism!", featuring a woman in a black niqab, have been plastered around Swiss cities.
Rival posters read: "No to an absurd, useless and Islamophobic 'anti-burqa' law".
The ban would mean that nobody could cover their face completely in public, whether in shops or the open countryside.
But there would be exceptions, including for places of worship, or for health and safety reasons.
The vote came at a time when face masks are mandatory in shops and on public transport due to the coronavirus pandemic.
'Xenophobic and racist atmosphere'
The Yes vote risks "trivialising the xenophobic and racist atmosphere" towards Muslim women, Meriam Mastour, of the Purple Headscarves feminist group, told broadcaster RTS.
Very few women wear the full veil in Switzerland, she stressed, and those that do tend to be converts and tourists.
A 2019 Federal Statistical Office survey found that 5.5 percent of the Swiss population were Muslims, mostly with roots in the former Yugoslavia.
"It's a huge relief," said Mohamed Hamdaoui, a regional lawmaker in the Bern canton and the founder of the "A Face Discovered" campaign.
He called the vote "the opportunity to say stop to Islamism" and not "to Muslims, who obviously have their place in this country".
Within Europe, Switzerland's neighbours France and Austria have banned full-face coverings, as have Belgium, Bulgaria and Denmark.
Several other European countries have bans for particular contexts, such as in schools and universities.
Government against ban
The Swiss government and parliament opposed a nationwide ban.
Their counter-proposal, which would have been automatically triggered if the initiative was rejected, would have required people to show their faces to the authorities if necessary for identification, such as at borders.
Under Switzerland's system of direct democracy, any topic can be put to a national vote as long as it gathers 100,000 signatures in the wealthy country of 8.6 million people.
Such votes take place every three months.
A 2009 vote that banned the construction of minaret towers on mosques sparked anger abroad.
Two other votes were held on Sunday.
A free trade agreement struck between Switzerland and Indonesia, put to the vote after opponents criticised Bern's move to reduce import duties on palm oil, narrowly gained approval with 51.7 percent support.
Tariffs will gradually be removed from almost all of Switzerland's biggest exports to the world's fourth most populous country, while the Swiss would abolish duties on Indonesian industrial products.
A government plan to introduce a federally-recognised electronic identity that could be used for ordering goods and services online was rejected with 64.36 percent of the vote.
It was pushed to a popular vote by critics alarmed at the plan to rely on private firms for the e-IDs, giving them access to sensitive, private information.