Muslim children in Switzerland have been told they must shake hands with their teachers at the beginning and end of lessons or face paying thousands of pounds in fines. A Swiss regional authority ruled a controversial exemption to the tradition, granted to two teenage brothers by their school, was unlawful.

The Muslim pupils, who attend a school in Therwil, northern Switzerland, had told their female teachers earlier this year they were not allowed to shake their hands because physical contact with women outside their family was forbidden by their religion.

The school's decision to then grant special dispensation to the boys, whose father is an Imam, caused national controversy.

A local teacher's union claimed the decision discriminated against women, while Switzerland's Justice Minister, Simonetta Sommaruga, said that shaking hands was part of Swiss culture and life.

The town's mayor, Reto Wolf, added: "In our culture and in our way of communication a handshake is normal and sends out respect for the other person, and this has to be brought [home] to the children in school."

A regional authority has now ruled teachers "had the right" to demand handshakes. It said in a statement on Wednesday (25 May) that "the public interest concerning gender equality as well as integration of foreigners far outweighs that concerning the freedom of belief of students".

Parents in Basel-Country now face a fine of up to 5,000 Swiss francs (£3,400, $5,000) if their children refuse a handshake from their teacher, according to AFP.

The boys told Swiss media they would ignore the "ridiculous" ruling, however, saying "nobody could make them" comply. They said their refusal to shake their female teachers' hands, which had seen them receive threats on social media, was to "protect the dignity of women".

The row had caused a split among the 350,000 Muslims living in Switzerland, which has a population of about 8m. The Federation of Islamic Organisations in Switzerland (FIOS) declared that shaking hands with a member of the opposite sex was "theologically permissible". It said the practice was a common form of greeting between men and women in several Muslim countries so should not be prohibited in Switzerland.

However, the Islamic Central Council of Switzerland argued the greeting was forbidden in Islam. It said: "Classical (Islamic) jurisprudence and the vast majority of contemporary legal scholars ... assume a clear prohibition of this contact form (handshakes) between the sexes."