Using an ordinance meant to target unlicensed or “bandit” taxis, the Los Angeles Police Department has been arresting hundreds of ride-hailing drivers in undercover sting operations. In 2013, when Uber and Lyft first entered the L.A. market, a mere 4 percent of bandit taxi arrests were against ride-hailing drivers. Today, that figure tops 40 percent, with over 240 ride-hailing drivers arrested just last year.

Here’s how the stings go down. Posing as ordinary pedestrians, undercover officers wave down cars with Uber logos. The drivers who stop typically think the person either needs help or can download the app on the spot. If drivers pull over, officers tell them they don’t have the Uber app but offer to pay in cash. Drivers who accept the fare are then met almost immediately by squad cars and handcuffs. No wonder some Uber drivers caught in a sting have called the city’s tactics entrapment.

The rise in arrests just so happens to coincide with plummeting demand for traditional taxis. In just three years, the number of taxi rides has plunged by almost a third. Drops were even starker in Hollywood and downtown L.A., where the number of trips fell by 44 percent.

Incredibly, the funding for the sting operations is provided entirely by taxi rides. As part of a deal reached back in 2006 to aggressively crack down on bandit cabs, each licensed taxi has to pay a $30 monthly fee.

That fee was also accompanied by a 20-cent fare hike, so that drivers could pass the cost onto their riders.

This year, the city budgeted nearly $850,000 for its sting operations. In other words, Los Angeles is taxing consumers on behalf of taxis so it can crack down on their competition.

According to some estimates, there may be upwards of 3,000 bandit taxis in Los Angeles. By comparison, the city caps the number of licensed cabs at over 2,300. Those figures suggest that although bandit cabs are outlawed, they satisfy an unmet, pent-up demand for transportation. Notably, bandit taxis have long been popular in ethnic communities underserved by traditional taxis, like in the city’s Koreatown. But instead of easing restrictions to allow more transportation options to serve more communities, the city launches routine crackdowns. Since Los Angeles began its “Bandit Taxicab Enforcement Program” a decade ago, police have made nearly 8,500 arrests and impounded more than 6,000 vehicles.

Los Angeles is just one of many flashpoints between incumbent taxis and their competitors. A new Massachusetts law will tax Uber and Lyft rides, in order to bail out the flailing taxi industry in Boston. In October, a federal appeals court ruled in favor of ride-hailing drivers in Chicago and rejected a demand for a bailout by Milwaukee taxi owners, after the city lifted its cap on cabs. A taxi permit, Judge Richard Posner wrote, “does not create a right to be an oligopolist.”

Thankfully, with the rise of Uber, more cities are keen to scrap burdensome regulations.

Two years ago, San Diego lifted its limit on taxi permits, which, thanks to artificial scarcity, could fetch upwards of $140,000 on the secondary market. In Orange County, Supervisor Todd Spitzer has proposed deregulation to “make it a level playing field” for Uber, Lyft and traditional taxis.

For just one example of how liberalization can work, consider Minneapolis. Ten years after the city deregulated its taxi industry, taxi licenses are up 185 percent, while the number of cab companies has more than quadrupled.

Just imagine how economic opportunity would accelerate if regulators would stop slamming the brakes on entrepreneurs.

Nick Sibilla is a writer at the Institute for Justice.