In a judgment on Friday, the Lausanne-based Federal Court said puberty also constituted no grounds for dispensation: the girl could cover up under an Islam-conforming burkini.
The 14-year-old girl from a strict Muslim family attends a district school in the canton of Aargau, the Swiss news agency SDA reported.
In 2011 her parents sought permission for their daughter to be excused from swimming lessons that took place every five weeks under the supervision of a male teacher. Girls and boys were taught separately.
The authorities rejected this request and have now been vindicated by the ruling of the Supreme Court.
In their appeal, the family had argued that as Shiites they followed a particularly strict form of Islam.
They said this did not allow their pubescent daughter to swim under the gaze of a male teacher – even if she was wearing a body-concealing swimsuit.
The family had also argued that the girl could already swim and attended a private swim course for Muslim girls.
In its ruling the Federal Court referred to a judgment establishing a principle from 2008. According to this decision, obligatory swimming lessons take precedent over religious duties.
The court also referred to the fact that the school had provided separate lessons for boys and girls.
As the girl could already swim she needed to have no physical contact with the male teacher.