Barcelona city hall said on Thursday it would fine home rental websites Airbnb and rival HomeAway 600 000 euros ($635 000) each for marketing lodgings that lacked permits to host tourists.
The fine comes as the popular seaside resort struggles with a rising tide of tourism that has exasperated locals, threatening to drive out poorer residents and spoil the charm of Spain's second-largest city.
In a statement, Barcelona said it had initiated proceedings "that will result in 600,000-euro fines for each of them for the repeat offence of advertising tourist lodgings online" without authorisation.
Under a 2012 regional law, any apartment rented to visitors in Catalonia must be logged in the province's Tourism Registry and have a permit.
The city council, which is led by former anti-eviction activist Ada Colau, said it had counted 3 812 lodgings on Airbnb and 1,744 on HomeAway that did not have the permit.
Colau is working to curb a boom in visitor numbers, fearing it will spoil the attraction of Barcelona, one of Europe's most popular destinations for short-term holidays, and rising real estate prices will drive out poor residents andd small shop-owners.
"It's not acceptable that there are thousands of flats operating illegally without a permit, without paying taxes and causing problems for the neighbours," she told Spanish radio on Thursday.
Airbnb said it would appeal the fine.
"Less than a month ago, we held a meeting with city hall representatives and Airbnb promised to work together (with city hall) to support the city's interests," it said in a statement.
"Airbnb is part of the solution in Barcelona."
- Dark side of tourism -
For many years the tourism boom was seen as a success story, but persistent issues with noise, rising housing prices and illegal tourist flats have led many of the city's 1.7 million residents to draw battle lines against the never-ending tide of visitors.
The issue was thrust into the spotlight in August 2014 when newspapers published photos of three naked Italian tourists roaming through the city's Barceloneta neighbourhood where there are many illegal tourist flats, shocking residents.
Earlier that year, a new documentary about the city's tense relationship with visitors, "Bye Bye Barcelona", warned that it was becoming "a theme park".
In December last year, city officials slapped Airbnb and HomeAway with a 30 000 euro fine -- which, at the time, was the maximum -- for offering for rent homes which lacked permits.
Then in June, city hall increased the maximum fine to 600 000 euros as the two sites continued to advertise holiday apartments that did not have permits.
This is the first time it has applied the fine.
San Francisco-based Airbnb claims that it provides a useful service by helping visitors find affordable temporary lodging while enabling homeowners to supplement their income.
In June, the European Union even warned member states against banning "sharing economy" services such as Uber and Airbnb, especially if only to protect existing businesses from competition.
But the global home sharing site has found itself in the crosshairs of many cities around the world, with tourism bosses seeing it as threatening revenues -- lacking as it does the legal and tax constraints of commercial enterprises.
New York, Miami and Berlin are just some of the cities that have cracked down.
As such, Airbnb -- which operates in more than 190 countries and has been valued at an estimated $30 billion -- has implemented measures to address this, such as a levy for overnight stays, effectively a hotel tax, from users in some countries.