Spain may be one of the world's top tourist destinations, but many people in its biggest cities have grown exasperated with Airbnb-style rentals.

And now, their city councils are taking action.

Airbnb and other peer-to-peer rental websites have for years been credited with enabling lovers of travel and culture to find new ways to explore foreign lands.

However, complaints have abounded in Spain that greedy landlords are throwing out long-term tenants in order to cash in on the tourist flow, and that the short-term leases are pushing up rent.

By introducing a slew of new rules, Madrid's leftwing city hall plans to make it impossible for short-term rental companies to rent out 95 percent of apartments in the Spanish capital by the end of the year.

To get a holiday rental licence homeowners will have to prove their property has a separate entrance from the rest of the building -- a condition that is in most cases impossible to fulfil.