Behind banners reading “Barcelona is not for sale” and “We will not be driven out”, some 2,000 people staged an “occupation” of the Rambla, the city’s famed boulevard, on Saturday.

The protest was organised by a coalition of more than 40 resident and community groups from all over the city, not just the neighbourhoods most directly affected by mass tourism.

Visitor numbers have grown exponentially in recent years. In 2016 an estimated 9 million people stayed in hotels and a further 9 million in holiday apartments. In addition, the city received around 12 million day-trippers arriving by car and train or on cruise ships.

Tourists looked on bemused as the banners were unfurled at the top of the Rambla, beside the Canaletes fountain.

“I don’t understand. What do they mean, Barcelona is not for sale?” asked Qais from Kuwait. “It’s not what we were expecting, but I can see their point,” he said when it had been explained to him. He added: “Things are really bad in the Middle East,” which put things in perspective. “Does it mean they don’t want us here?” his wife asked. Birgid from Denmark was less sympathetic. “Tourism brings in lots of money to the city, doesn’t it? I’m sure it’s changed the city, but that’s life, isn’t it?”

Roger from Wigan, here on his second visit, commented: “I can understand it, the place is very commercial. And if I understand what’s written on some of these placards, they are complaining that tourism is forcing their rents up. I can sympathise with that.”

This was one of the key issues behind the march, as the money to be made from holiday lets is forcing rents up and driving people out of the city.

Christine, an Englishwoman on the march who has lived in Barcelona for more than 20 years, said: “We’ve been renting our flat in the old town for 17 years. In that time I reckon we’ve paid around €150,000 in rent. Now they want to kick us out because they can make more money renting it out to tourists.”

The march coincided with a new law seeking to curb tourist accommodation. Photograph: Stephen Burgen/The Guardian

The march coincides with a new law passed by Barcelona city council on Friday that, for the first time, seeks to curb tourism. The special urban plan for tourist accommodation aims to limit the number of beds on offer from hotels and apartments by imposing a moratorium on building new hotels. No new licences will be issued for tourist apartments.

There are currently 75,000 hotel beds in the city and around 100,000 beds in tourist flats, at least half of them unlicensed and illegal. The city is at loggerheads with Airbnb, the principal letting agency. Last year the council fined Airbnb and HomeAway €600,000 each for advertising unlicensed apartments.

Airbnb argues that the overwhelming majority of its clients in the city are people who are letting out rooms as a way of making ends meet during Spain’s prolonged financial crisis.

“That may be true up to a point, but it masks the real problem, which is speculation,” says Daniel Pardo, a member of the Neighbourhood Assembly for Sustainable Tourism. Yet people are free to visit the city, so what’s to stop them?

“One thing we could do is stop spending millions on promoting tourism,” says Pardo. “We’re subsidising tourism with public money, by exploiting workers in the service economy and exploiting the infrastructure of the city, which we citizens pay for. Furthermore, tourism is distorting the economy and there is little support for anyone who wants to establish non-tourist enterprises.”

The good-humoured march moved to the seaward end of the Rambla, where one of the organisers read out a manifesto calling for more local shops, more homes, rather than businesses, and control of the pollution caused by private cars and cruise ships. “It’s a great turnout,” one of the marchers quipped. “There are more people here than at Trump’s inauguration. The citizens have never been consulted about this, although they’re the ones who suffer the consequences and aren’t enjoying the benefits. [We’re asking for] the debate to be opened to everyone and that we reach some other resolution of the problem, instead of the present one based on continuous growth.”