BERLIN -- Swiss voters appeared on course Sunday to narrowly approve a proposal to ban face coverings, both the niqabs and burqas worn by a few Muslim women in the country and the ski masks and bandannas used by protesters.

The measure would outlaw covering one's face in public places like restaurants, sports stadiums, public transport or simply walking in the street. There would be exceptions at religious sites and for security or health reasons, such as face masks people are wearing now to protect against COVID-19, as well as for traditional Carnival celebrations. Authorities would have two years to draw up detailed legislation.

The Swiss government opposed the measure and says that people covering their faces is a "marginal" issue. It argued 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 Swiss lakeside cities. And it says that it wouldn't help the women affected.

It backed instead requiring people to show their faces if requested to do so by authorities.

Supporters of the proposal, which came to a vote five years after it was launched and came to be known colloquially as the "burqa ban," argued that the full-face coverings symbolize the repression of women and said the measure is needed to uphold a basic principle that faces should be shown in a free society like Switzerland's.

A projection for national public broadcaster SRG nearly two hours after polls closed put support for the proposal at 52%, with a margin of error of plus or minus 2 percentage points. Lukas Golder of polling agency gfs.bern told SRG's SRF television channel that a defeat was "practically almost ruled out."

The close outcome was in line with pre-referendum expectations.

Two of Switzerland's 26 cantons, or states, Ticino and St. Gallen, already have similar legislation that foresees fines for transgressions. National legislation would put Switzerland in line with countries like Belgium and France that have already enacted similar measures.

Backers included the nationalist Swiss People's Party, which is the strongest in parliament. The committee that launched the proposal is led by a lawmaker from the party and also initiated a ban on the construction of new minarets that voters approved in 2009.

This time around, a coalition of left-leaning parties that opposes the proposal put up signs that read: "Absurd. Useless. Islamophobic."

Experts estimate that at most a few dozen Muslim women wear full-face coverings in the country of 8.5 million people.

Voters had their say on two other issues Sunday. Projections showed them clearly rejecting a proposed voluntary "e-ID" to improve the security of online transactions -- an idea that ran afoul of privacy advocates, as it would have been issued by private companies -- and likely narrowly approving a free-trade deal with Indonesia.