The European Court of Human Rights (ECHR) said school bosses are justified in enforcing the “full school curriculum” and children’s “succesful integration” into society.
Although the court recognised religious freedoms were being interfered with, judges said there was no violation.
The ECHR held unanimously, that there had been “no violation of Article 9 (right to freedom of thought, conscience and religion) of the European Convention on Human Rights”.
The landmark case came after a complaint from Muslim parents, who objected to sending their daughters to compulsory mixed swimming lessons
Switzerland last year rejected citizenship requests from two Muslim girls for refusing to take part in swimming lessons with boys at school.
The 12 and 14-year-old will no longer be considered for naturalised citizenship because they refused to comply with the school curriculum, officials said.
The girls had refused to swim because of the presence of boys citing theire religion as of banning that form of interaction.
A father of another two girl was fined 4,000 swiss francs (£2,900) at a county court for refusing to let his daughters swim with boys.
Switzerland is said to be struggling to cope as it is fast becoming the route of choice for migrants trying to enter Germany after many Balkan countries have sealed off their borders.
The country was branded “racist” after 60 per cent of Swiss citizens voted in 2009 “against the construction of minarets” – the towers that deliver the call to prayer on either side of mosques – in the country.