MADISON (AP) – Evidence of a prior consensual sexual relationship between a Milwaukee man and a woman who accused him of rape was properly excluded from his trial, the Wisconsin Supreme Court ruled Tuesday.

The Supreme Court sent the case back to the state appeals court to rule on other issues Muhammad Sarfraz raised on appeal.

Sarfraz was found guilty of second degree sexual assault in 2011 and sentenced to 10 years in prison. He argued on appeal that evidence he and his accuser had previously conducted a consensual sexual relationship should have been admitted at trial. The state court of appeals agreed, saying the full extent of their relationship would allow the jury to question the allegations against him.

The Supreme Court on Tuesday reversed that ruling, saying the evidence was properly excluded under the state’s rape shield law. That law generally prohibits introducing any evidence concerning the victim’s prior sexual history or reputation.

Justice Michael Gableman said Sarfraz failed to show that the value of the evidence of the alleged prior consensual relationship outweighed its inflammatory and prejudicial nature.

Many facts in the case are disputed.

The victim and her father lived with Sarfraz when they first emigrated to Wisconsin from Pakistan, although Sarfraz later moved into a separate apartment. Court records show that Sarfraz entered the woman’s apartment on May 15, 2010, and while there they had sex. After Sarfraz left, the woman was found naked in the hallway from the waist down, screaming that she had been raped. Court records say the woman accused Sarfraz of holding a knife to her throat then raping her, and that both had suffered knife wounds.

The state charged Sarfraz with second degree sexual assault, while he alleged the sexual contact was consensual.

Sarfraz’s attorney, Jason Luczak, did not immediately return a telephone message seeking comment. Dana Brueck, spokeswoman for the state Department of Justice which prosecuted the case, declined to comment.