The regional government in the Balearic islands has passed a bill aimed at clamping down on alcohol-fuelled holidays.

The law bans happy hours, free bars and two-for-one drinks parties and makes it illegal to advertise pub crawls. There will be no new licences for party boats and existing boats are banned from operating in designated areas.

Shops selling alcohol that stay open all night will have to close between 9.30pm and 8am or risk fines of up to €600,000 (£511,000) or the threat of being closed down for three years.

The restrictions apply to the worst affected areas of Magaluf and El Arenal de Palma in Mallorca as well as Sant Antoni de Portmany in Ibiza.

“It’s an exceptional law for a particular area and a specific problem,” said Iago Negueruela, the Balearics’ tourism minister.

In a press release, the government claims it is the first European law restricting the sale and promotion of alcohol in specific tourist areas. It said: “It will have a considerable impact outside of Spain.”

The legislation also seeks to outlaw “balconing”, the practice of jumping into a swimming pool from a hotel balcony that kills several people each year. In future, hotels will have to evict anyone practising balconing or encouraging others to do so.

The law, which goes further than similar measures introduced in 2015, was drawn up in consultation with the tourist industry, itself conscious of the damage to its image caused by drunken holidaymakers and the rise of so-called turismofobia among local residents.

“Attracting this type of excessive tourism is counterproductive,” said José Luis Zoreda, the vice-president of the tourist association Exceltur, who said the sector welcomed the legislation. “This is why in some areas hoteliers are changing what they offer in order to attract a different type of visitor.”

All-in-one packages, often with a free bar, are popular among young British tourists who have helped to make places such as Magaluf notorious. It has been nicknamed “Shagaluf” because of its reputation for drunken casual sex.

The area’s reputation hit a nadir after mobile phone footage circulated of an 18-year-old Northern Irish woman giving oral sex to 24 men on a pub crawl.

In 2015, officers from West Midlands police force joined local civil guard patrols in Sant Antoni and Magaluf in an effort to rein in binge drinking and other excesses. Each year, several hundred Britons are arrested on the islands, mostly for drunkenness and antisocial behaviour.

Cities and towns across the European continent have made moves in recent years to clamp down on over-tourism or forms of tourism deemed undesirable.

Venice has introduced a number of new rules to manage tourists, including a ban on sitting in public places. People can already be barred from the Italian city or fined for drunken behaviour and swimming or dipping their toes in the canals. Snacking on steps or while walking along the street are also frowned upon. Each summer, a group of so-called “angels of decorum” patrol the main tourist areas to ensure people are respecting the rules.

In the UK, Dave Meredith, the most senior police officer in Newquay, has been credited with transforming the Cornish coastal town’s reputation as a party destination in the early 2000s by taking a stand against those pubs and clubs deemed to be fuelling the disorder. Meredith, who retired at the end of last year, also launched a crackdown on underage drinking, which has discouraged large groups of post-GCSE students from descending upon the town in the summer.