The Constitutional Court in Karlsruhe rejected an appeal by the girl's parents that she should be excused the classes because a burkini did not conform with Islam's ethic of decency, German media reported.
Dutch lawmakers look into partial niqab ban
A spokesman for the court could not be reached for comment.
Germany is in the grip of a heated public debate about the role of Islam in society as it seeks to integrate more than a million mainly Muslim asylum seekers fleeing war and persecution who have entered this year and last.
Chancellor Angela Merkel, whose conservatives have been punished at the polls in regional elections by voters angry at her open-door policy, on Tuesday proposed a ban on full-face Muslim veils.
Her Christian Democrats, who have been bleeding support to the AfD, a populist party that says Islam is incompatible with the constitution, toughened their tone on integrating migrants at a party conference this week.
Wednesday's ruling could give more credibility to future attempts by the government to ban the full-face veil after a parliamentary election next year.
'Hero' Muslim police officer harassed over hijab in New York
The girl had argued before lower courts that swimming in a burkini revealed the shape of her body, something that goes against her religion.
The Constitutional Court noted that lower courts had found this to be untrue, and further found there were "no binding rules in Islam" to define appropriate clothing.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ