A United Kingdom court on Saturday ordered a man in his mid-40s to give 24 hours’ notice before any planned sexual activity, or face five years in prison. The man, whose identity cannot be disclosed, was acquitted of rape by the same court, after he claimed that the victim had consented.

According to the court order, the man has to provide the police with the details of his potential sexual partner including her name, address and date of birth. The bench also restricted his use of the Internet and mobile phones.

The York court’s ruling was part of the “sexual risk” orders that were brought into force in England and Wales in March last year. They are applied to people whom the police believe might cause sexual harm, regardless of conviction for a past crime.