MADRID (Reuters) - Spanish taxi drivers ended a six-day strike late on Wednesday after the government agreed to set tough limits on licenses for online ride-hailing companies including Uber, the latest setback for a company that has faced protests in many countries.

Slideshow ( 2 images )

Thousands of taxi drivers across the country had blocked major city streets with their cabs in protest against competition they say works under less restrictive regulations that make it impossible for them to compete.

The government agreed to pass new regulations in September guaranteeing a cap on licenses for Uber and similar services at a ratio of just one permit for every 30 taxi permits.

A representative of the ride-hailing services said some taxi drivers had attacked its members during the strike. Spain’s taxi association said it condemned all violence.

Ride-hailing services, which offer rides that undercut taxi prices online rather than being hailed in the street, have become increasingly popular worldwide in recent years.

Backed by investors including Goldman Sachs and BlackRock and valued at more than $70 billion, Uber views Western Europe as an increasingly important market.

It has pulled out of China, Russia and Southeast Asia, and its future in India, where it is battling local rival Ola, is in question.

London cab drivers are considering bringing a class action suit against Uber after the mobile app was granted a temporary license 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.

If the new regulation in Spain is not fully enforced by September, taxis would strike again, National Taxi Association president Julio Sanz said in a statement.

The legislation would prompt the layoff of thousands of drivers from Uber and ride-hailing rival Cabify as they currently have 9,000 permits compared with 70,000 for taxis, far from the 30:1 ratio agreed with unions.

The ride-hailing services reported a significant number of attacks against their members by taxi drivers during the strike.

There were “very serious incidents including cars being stoned, cars overturned, gun shots and a great number of drivers treated for stress and bruises,” their representative Eduardo Martin said.

The taxi association said its representatives condemned all aggression and violence, and urged members to keep all protests peaceful.