Switzerland stands by the principle of freedom of opinion but rejects any form of racism, the government has stressed.
Responding to United Nations criticism, it said that while racism was unacceptable, it was up to the courts to determine whether particular statements violated anti-racism laws.
"In a democratic society freedom of opinion must be defended, in particular in the context of political debate," the government said in a letter responding to charges laid by two UN special rapporteurs.
Last month the rapporteurs complained about the controversial "black sheep" campaign by the rightwing Swiss People's Party, which calls for foreign criminals to be expelled from the country.
The posters show three white sheep standing on a Swiss flag kicking out a black sheep with the slogan "Create Security".
Doudou Diène, the UN special rapporteur on racism, and Jorge Bustamente, the rapporteur on the rights of migrants, asked the Swiss government for an explanation.
The campaign has aroused considerable debate within Switzerland. Swiss President Micheline Calmy-Rey, a member of the centre-left Social Democrat Party, said it "stirs up hatred" and "disgusts" her.
Roman Jäggi, spokesman for the People's Party, hit back, saying the campaign was "completely fair".
"We have a big problem with violence and in particular youth violence, and foreign criminals are a big factor," he told swissinfo.
Diène's complaint about the poster campaign was not the first time he had expressed concern about racism in Switzerland.
In March this year he submitted a report to the UN Human Rights Council in which he accused the Swiss authorities of lacking a "coherent and resolute political strategy against racism and xenophobia".
In his 2006 report he had noted that racism, xenophobia and discrimination were "trivialised" in political debate in Switzerland and also observed strong evidence of institutional racism, including within the police.
The government rejected the conclusions of both reports, but said it would step up efforts to combat racism and discrimination.
swissinfo with agencies
Reported racist incidents in Switzerland (according to Foundation against Racism and Anti-Semitism)
2006: 88 cases, including 23 of verbal racism
2005: 111 cases, including 44 of verbal racism
2004: 109 cases, including 29 of verbal racism
2003: 116 cases
2002: 128 cases
The Swiss People's Party and foreigners
Recent policies of the rightwing Swiss People's Party with regard to foreigners in Switzerland include:
Foreign residents who commit crimes in Switzerland should be expelled after serving their sentences. If they are minors, the parents should be expelled with them.
The construction of minarets – the traditional tower of a mosque – should be forbidden in Switzerland.
When foreign residents of a commune want to acquire Swiss citizenship, the commune should continue to have the right to put their applications to a popular vote.
Foreigners who do not learn the language of the area in which they are resident must leave the country.