New legislation gives Danish courts the ability to ban violent offenders from bars, pubs and restaurants, as well as anywhere that serves alcohol, between midnight and 5am.

In recent weeks, a court imposed a nine-month ban on a 24-year-old man who had been sentenced to five months in prison for violent behavior, while Copenhagen police said on Monday that a 31-year-old convicted felon has been issued a nightlife ban for eight months.

Courts can hand down bans for up to two years, with offenders facing a fine of 10,000 Danish crowns ($1,500) if they violate it once – or up to 30 days in prison if they repeatedly enter areas from which they’ve officially been barred.

Speaking to Reuters, Copenhagen police officer Tommy Larsen praised the legal measure, declaring it to be a “tool that affects the few but which helps the many.”