Berlin tenants are cheering – and Berlin tourists fuming – after Airbnb purged thousands of apartments from its online letting portal ahead of a crackdown on holiday lets from May 1st.

Within a month, Airbnb has almost halved its Berlin listings to 6,700, banning thousands of landlords who were letting entire apartments on a commercial basis. A search on Wednesday showed just 306 apartments available in June.

Amid spiking rents and a growing housing shortage in the German capital, local politicians and tenant groups have welcomed the Airbnb move.

It comes days before the end of a two-year transition period for a new law forbidding commercial, short-term let of apartments to tourists of apartments without a city permit. Anyone who does so from Sunday risks a fine of €100,000. Studies estimate the number of holiday lets in Berlin at about 15,000, while just 6,300 landlords have applied for a holiday let permit.

Last February Berlin’s city government ordered Airbnb to hand over the details of its clients in the capital. The company attempted to secure a loosening of the new law against holiday lets, but to no avail. Dumping commercial landlords has been interpreted as an attempt to avoid being dragged into legal action with the city authorities – and face a total ban on operations.

“A larger number of the apartments that Airbnb offers in Berlin are apartments diverted from their intended purpose for commercial use,” said Andreas Geisel, Berlin’s planning minister. He insisted that the “pleasant side” of Airbnb – renting out a spare room – was still possible after May 1st.

“But we want to forbid apartments being taken from the rental market to make more profit.”

For years city tenants’ associations have called for action on the largely unregulated holiday let sector, arguing it prices regular Berliners out of the housing market. Tenants in blocks with holiday apartments complain that Airbnb landlords ignore complaints of customers’ antisocial behaviour.

“In some areas of the city, like Kreuzberg, we have more holiday apartments on offer at the moment than regular ones,” said Rainer Wild, head of the Berlin Tenants’ Association. “That means that, for every normal apartment, there are ever-more applicants.”

City holiday apartment owners have joined forces and promise legal action against a ban they say will ruin them.

“I’ve built up an existence over nine years, I won’t give up without a fight,” said Alexander Buthmann, a holiday let landlord, on Berlin’s Inforadio.

Holiday let landlords argue that Berlin’s estimated 15,000 holiday flats are a miniscule share of Berlin’s 1.9 million apartments.

They argue the government is targeting them to distract from their failures to build affordable housing. Last week it emerged that a city-owned housing agency rents out 7,000 furnished apartments of its own.

Holiday let landlords are confident the courts will eventually rule that the holiday flat ban represents an unacceptable state curtailing of constitutional property rights. But, in a taste of things to come, a Berlin court on Thursday dismissed a legal challenge against the city by a woman who was refused a legal permit to let out a flat to tourists. Without the holiday let income she told the court said she couldn’t afford the mortgage on the flat.

A Berlin court said there was nothing preventing her taking a regular tenant and using their rent to pay off the mortgage, and dismissed the claim.

It’s not the first time Airbnb has cracked down on commercial holiday lets after pressure from city authorities. When New York demanded a full register of holiday let landlords in the city, the company dumped 1,500 listings.