The participants waved flags and held a banner reading "Slovakia is not Africa".
Carrying a banner bearing the slogan "Multiculturalism equals genocide", some protesters tore up an EU flag and launched tear gas at the police.
Two police officers were injured and 140 of the most violent protesters were arrested.
Later, at the local train station, unidentified attackers threw bottles and stones at an Arab family.
Slovak extremist groups come out against the European Commission’s idea of resettling 800 migrants in the country. According to an opinion poll conducted earlier this week, over 70 percent of Slovaks reject the immigration quotas set by the European Commission.
The European Commission wants EU governments to agree to resettle over the next two years 40,000 asylum-seekers who reached Italy and Greece, many after perilous boat trips across the Mediterranean in which hundreds have died.
Only refugees from states deemed by the EU to be facing the worst strife and conflict will be taken in.
The plan will be discussed at an EU summit on June 25-26.
Italy and Greece, bearing the brunt of the migrant wave, have repeatedly called on fellow EU states to share the burden.
Slovak Prime Minister Robert Fico, hosting a meeting of the Visegrad countries of Slovakia, the Czech Republic, Hungary and Poland, said issuing quotas among member states flew against earlier EU decisions.
He said the four countries supported a voluntary approach.