BERLIN — Germany’s top criminal court on Friday upheld the attempted rape conviction of a former priest who posed as a woman online in an elaborate scheme to try to orchestrate the sexual assault of a former lover.

The Federal Court of Justice in Karlsruhe rejected the 61-year-old’s claim that there had been procedural errors in his 2016 conviction in Stendal state court, upholding his three year prison sentence.

The court said the priest, whose name was not given in line with privacy laws, posed as a woman in an “erotic dating portal” in 2016, looking for men to “rape role play.”

In online conversations with two men, he gave the address of a woman the court said was his former lover in order to get the men to “visit the victim at home and to perform violent sexual acts on her.”

“The injured party, who knew nothing of all of this, was able to prevent the crime from being carried out in both cases after the men arrived,” the court wrote.

The court refused to provide further details, but according to media reports of his original trial, his victim was the daughter of a colleague, 30 years his junior, over whose confirmation he presided as a priest in the Salzwedel area, about 200 kilometers (120 miles) west of Berlin.

Posing online as a woman using the pseudonym “Blonde Bunny” claiming the fantasy was her own, he gave the men specific instructions, including saying that they should not be deterred if she were to fight back, the local Volksstimme newspaper reported.

One said he was also told to turn away if the woman’s mother was at home.

When the first man arrived she was able to force him away, and when the second man arrived at a different time he sensed something was awry, and told her about the chats with “Blonde Bunny.”

The victim confirmed the chats were not from her, and the two drove together to the police to report the crime.

The priest, who has been on long-term sick leave, is also under disciplinary investigation by the church. His motivation for the crime was not clear.