The European Court of Human Rights (ECHR) ruled unanimously Tuesday in favor of a Swiss school’s decision not to exempt two Muslim students from its obligatory mixed-gender swimming lessons, finding that the school did not violate the students’ religious freedoms as their parents claimed.

Here’s what happened: In 2010, Aziz Osmanoglu and Sehabat Kocabas, Swiss nationals of Turkish origin, did not want to send their two daughters, aged 11 and nine-years-old at the time, to compulsory mixed-gender swimming classes at the girls’ school in the northwestern city of Basel. The couple said the lessons, which would involve their daughters wearing swimsuits in front of their male peers, violated their Muslim faith, which in some interpretations requires separation of the sexes. School authorities said exceptions could only be made for students who have reached puberty—the school determined the girls in question had not—and offered the girls the option to wear a burkini, a full-body swimsuit, to class, as well as access to female-only dressing areas. The school authorities warned the parents could face fines of approximately $1,292 euros ($1,364) if the girls continued to skip the lessons.

But the girls did.

The parents appealed the school’s decision to the Court of Appeal of the Canton of Basel Urban, which dismissed their claim in May 2011. Another appeal was filed with a Swiss federal court, which dismissed the claim in March 2012 on the grounds the students’ religious freedoms had not been violated. In April 2012, the parents filed an application with the ECHR, whose decisions are legally binding, arguing the school’s decision violated their rights under Article 9 of the European Convention of Human Rights, which protects religious freedoms except in cases that “are prescribed by law and are necessary in a democratic society.”

The Strasbourg-based ECHR, unlike previous courts, acknowledged that the students’ case did constitute a religious issue and that the school’s decision caused an “interference” with their freedom to practice their faith. But it also acknowledged the school’s decision was not aimed not at violating the students’ faith, but “to protect foreign pupils from any form of social exclusion.” In the end, the court decided that the latter took precedence over the former, ruling that the school’s decision, paired with the flexible arrangements it proposed for the girls, did not constitute a religious violation. Here’s more from the ruling:

The children’s interest in a full education, facilitating their successful social integration according to local customs and mores, took precedence over the parents’ wish to have their daughters exempted from mixed swimming lessons and that the children’s interest in attending swimming lessons was not just to learn to swim, but above all to take part in that activity with all the other pupils, with no exception on account of the children’s origin or their parents’ religious or philosophical convictions.

The parents have three months to appeal the decision to the ECHR’s Grand Chamber.

This isn’t the first time the court has favored integration over religious freedom. In a July 2014 case concerning a French Muslim woman’s right to wear the burqa— a full body covering that has been banned in France since 2011— the court ruled that though the proscription acted as a “continuing interference” of the woman’s right to privacy and religious freedom, it did not constitute a violation of her rights and was necessary to ensure that French citizens are “living together” in society.

Erik Bleich, a professor of political science at Middlebury College, told me that there are key differences between these two cases— notably,  Switzerland’s willingness to reach a compromise.

“This isn’t a case of Switzerland bringing the hammer down on adults,” Bleich said.“I read Switzerland in this case as saying, we’re trying to be flexible, we’re trying our best to offer separate changing rooms, the opportunity to wear a burkini. … The parents, in this case, are saying we don’t want to be flexible and we’re going to pursue this to the highest judicial appeals level that we can.”

Janina Rashidi, a spokeswoman for the Islamic Central Council of Switzerland (ICCS), told me that though the ICCS, which did not play a formal role in the proceedings, accepts the court’s decision so long as students have the option to wear more conservative swimwear, the ruling still demonstrates a form of intolerance against the Muslim community.

“It is not clear how going to swimming class once a month will support integration in a way that makes it more important than the religious beliefs of the girls,” Rashidi said.

She added: “In parts of Switzerland, as well as in Basel, it is possible to homeschool children. Nobody would claim that these children face a lack of integration even though they are not schooled with classmates at all.”

This isn’t the first time Muslim students have faced fines for not participating in parts of the Swiss education system deemed to violate their religious beliefs. In September, a local school council in the Swiss town of Therwil, in Basel canton, said two male Muslim students could face a $5,000 fine and disciplinary action for refusing to shake their female teacher’s hand. A handshake between teachers and students at the beginning and end of each school day is considered a Swiss tradition—one which the students said violated their religious beliefs. Though the boys originally reached a compromise with the school district, agreeing not to shake any teacher’s hand, regardless of gender, in order to maintain neutrality, regional education authorities overruled the agreement and insisted the tradition be maintained.

The reaction by the Muslim community was mixed. Montassar Ben Mrad, the president of Federation of Islamic Organizations in Switzerland, told the Washington Post the tradition was in alignment with Islamic teachings, noting: “Can the denial of shaking hands be more important than the Islamic commandment of mutual respect?”

ICCS, however, said the reaction to the boys’ refusal was overblown.

“Things which have not been a problem are made up as a problem relating to integration,” Rashidi told me. “[The boys] found a solution that shows respect to their teachers, male and female, without having to be forced to have physical contact, which is against their beliefs. They have never been unintegrated and have always shown respect, as pupils should.”

The issue of integration in Swiss society, in which Muslims make up nearly 5 percent of the 8-million strong population, has extended beyond the school system. In 2009, Swiss voters passed a referendum banning the construction of minarets from the top of mosques, where Muslims traditionally issue the call to prayer—a move Swiss Justice Minister Eveline Widmer-Schlumpf said “reflects fears among the population of Islamic fundamentalist tendencies,” but cautioned, “is not a feasible means of countering extremist tendencies.” In 2015, the Swiss canton of Ticino issued a burqa ban paired with a fine of up to nearly $10,000 for violations—a penalty considerably higher than countries with similar bans such as France (where the fine is $205) and Belgium ($197).

Indeed, the issue of integration has extended beyond Switzerland. Throughout Europe, the issue of assimilation of the region’s Muslim population has been the subject of contentious debate—ranging from the right of Muslim women to wear full-body veils, or burqas, in public, to the permissibility of Muslim women wearing swimsuits of their choosing on French beaches. Calls to issue a burqa ban in Germany have been renewed and has gained support by politicians, like German Chancellor Angela Merkel, who previously opposed such a ban—a debate that could reemerge during the country’s elections in fall 2017.

“A lot of politicians are realizing they can make some hay by claiming that it’s really only the immigrants and only the Muslims that should be bending,” Bleich, the Middlebury professor, told me. “That’s where the inflexibility tends to come in, with far-right politicians saying, ‘we’re tired of bending … they came here and it’s their job to change, not our job to change.’”

Rashidi told me such proscriptions hamper integration rather than encourage it.  

“To force Muslims, Jews, or other groups to let go of their religious convictions doesn’t lead to integration and to a feeling of being part of society,” Rashidi said. “[It leads] to the feeling of being misfits, of being not accepted the way they are.”

But when it comes to successful integration, Bleich says it requires effort by both parties.

“On a philosophical level, it’s got to be a two-way street,” Bleich said. “The immigrants that come have to be flexible and willing to adapt to the rules and norms of the host society. But the host society must also be willing, within reason, to be flexible and adapt to the needs and identities of the immigrants.”