DUNDEE, Mich. — A federal appeals court has ruled in favor of a Monroe County school district in a lawsuit over a sexual relationship between a basketball coach and a player.

The court says the Dundee district and school officials were unaware of what was happening in 2009 and 2010 and aren’t liable under federal civil rights law. The court on Thursday upheld a decision by a federal judge in Ann Arbor.

Middle school basketball coach Richard Neff had sexual contact with a player more than a dozen times before a janitor caught them in a closet.

The girl’s mother argued that officials knew there was a risk of harassment or abuse. But the court disagreed, saying the relationship appeared to be a secret.

Neff is in prison for criminal sexual conduct.