SAN FRANCISCO — Over the last few years, so-called sharing companies like Airbnb and Uber — online platforms that allow strangers to pay one another for a room or a ride — have established footholds in thousands of communities well before local regulators have figured out how to deal with them.

A sign in a store window in San Francisco backing a proposition that Airbnb opposed; it was easily defeated
A sign in a store window in San Francisco backing a proposition that Airbnb opposed; it was easily defeated © Jason Henry for The New York Times

Now, as cities grapple with the growth of these services and try to pass rules for how they should operate, the companies are fighting back by turning their users into a vast political operation that can be mobilized at any sign of a threat.

Airbnb offered the latest and most vociferous example of this on Wednesday. Fresh off defeating a San Francisco measure that would have severely curtailed the company’s business in its hometown, Airbnb staged a news conference that functioned as a warning shot to other cities thinking about proposing new regulations.

The event was billed as a debriefing to discuss the defeat of Proposition F, which would have toughened existing rules for the service by, among other things, cutting the number of nights people could rent out rooms in their homes.

But the briefing was less about the actual election than an attempt to turn the results into a mandate for the sharing economy.

Chris Lehane, a Washington political operative who now serves as Airbnb’s head of global policy and public affairs, framed Proposition F as a hotel-industry-led attack on the middle class.

In this city of about 840,000 people, roughly $8 million was raised by groups opposed to Proposition F — about eight times the amount raised by the proposition’s backers, according to records filed with the San Francisco Ethics Commission.

Much of that money was spent mobilizing Airbnb hosts and users, Mr. Lehane said. Still, he repeatedly homed in on one of the company’s most important talking points: Airbnb’s victory was a win for the middle class.

“Cities recognize where the world is going, right, they understand that you’re either going to go forward or you’re going to go backward,” he said. “They understand that in a time of economic inequality, this is a question of whose side are you on: Do you want to be on the side of the middle class, or do you want to be opposed to the middle class?”