Spanish taxi drivers ended a six-day strike late on Wednesday after the government said it will limit licences for online ride-hailing companies such as Uber, the latest setback for the service following global protests by taxi drivers.

For almost a week, thousands of taxi drivers across the country blocked major city streets with their cabs in protest against the services they claimed worked under less restrictive regulation that made it impossible to compete.

The services, which offer rides via a online application rather than hailing in the street, have become increasingly popular in Spain in recent years, boosted by deals that undercut taxi prices on trips to airports and other travel hubs.

The government agreed to pass new regulations in September which will guarantee a cap on licences for the services at a ratio of just one permit for every 30 taxi permits.

The ruling, which will hand regulation of the services to each of Spain's 17 regional authorities, is the latest hit for the ride-hailing companies which have faced strong opposition by taxi associations in many countries.

Backed by funds such as Goldman Sachs and BlackRock and valued at more than $70 billion, Uber has faced protests, bans and restrictions as it challenges traditional taxi operators.

London cab drivers are considering bringing a class action suit against Uber after the mobile app was granted a temporary licence renewal to operate in the British capital.

The explosive growth of for-hire vehicles in New York and a rise in suicides by yellow taxi drivers struggling to compete has prompted the municipality to consider capping the services, the first such restriction in the country.

In Spain, the enforced legislation will prompt the layoff of thousands of Uber and Cabify drivers as there are currently 9,000 permits granted to the online services compared to 70,000 taxi permits, far from the 30-1 ratio agreed on Wednesday.