SAN FRANCISCO — Voters here re-elected Mayor Ed Lee and threw out embattled Sheriff Ross Mirkarimi while soundly rejecting two measures prompted by the city’s housing crisis.

Proposition F, which would have restricted Airbnb and other home share platforms, lost. Proposition I, which would have frozen luxury housing construction in the city’s popular Mission District, also went down.

A $310 million housing bond was passing with more than 70 percent of the vote; it needed two-thirds to pass.

San Francisco has become a national symbol of income inequality as newcomers shell out $1 million to buy small, high-end condos while longtime tenants battle eviction.

Lee was always favored to win re-election even as the San Francisco ballot reflected deep concern over the tech-driven development he’s championed in his five years in office. He faced five little-known candidates who had not raised much money.

Critics said he caters too much to Silicon Valley, citing his brokering of a tax break in 2011 to benefit Twitter as part of a remake of the city’s downtown. His campaign argued that the city struggled with housing long before he became mayor.

Lee spent much of the campaign touting Proposition A, a $310 million bond for affordable housing he said is badly needed to address the city’s lack of housing.

San Francisco voters last approved a housing bond in 1996, rejecting two others in 2002 and in 2004.

Lee told reporters Tuesday night that the focus of his second term would be on housing and homelessness, with a strong focus on public safety.

Perhaps the most divisive measure on the ballot was Proposition F, which would have limited home-shares to a strict 75 nights and required Airbnb and other hosting platforms to pull listings that exceed the limit.

San Francisco-based Airbnb spent more than $8 million to defeat the measure, drawing national attention to an issue that’s hitting cities large and small.

Proponents in San Francisco said the proliferation of short-term rentals is squeezing the city’s already tight housing market.

In the sheriff’s race, challenger Vicki Hennessy won decisively over Mirkarimi, who set off a national firestorm this summer when his office released a Mexican national despite a federal immigration request to keep him in custody. The man later shot and killed a woman on a San Francisco pier.

He has also endured a series of personal and official embarrassments, including an arrest on domestic violence charges in 2012 that his wife says was politically motivated.

Hennessy joined the sheriff’s department in 1975 and rose to chief deputy, the third-highest ranking position in the office. The San Francisco native retired five years ago after directing the city’s emergency services agency.

The issue that sparked the most interest: housing.

“When people can’t afford to live in the city, it just changes overnight,” said Michael Reiner, 24, an advertising industry freelancer who moved here two years ago and “got lucky” when he found a rental in the Sunset District. “I think it’s the defining issue for the city.”

Reiner had given his resounding approval to Proposition F, the most visible of a host of housing-related measures on the ballot, and one closely watched by other cities. It would tighten restrictions on short-term housing rentals, taking aim most pointedly at Airbnb in the hometown of the sharing economy tech giant, valued at $25 billion.

But the measure trailed in early returns Tuesday night.

Airbnb spent more than $8 million to defeat the proposition, which among other requirements would limit rentals to 75 days a year regardless of whether they are hosted (even if residents are renting a room in their homes while they are still there).

It would also crack down with potential misdemeanor charges on hosting platforms that list unlawful short-term rentals, and allow “interested parties” such as neighbors to sue companies that don’t play by the new rules.

The costly ballot fight became an emblem of the widening inequities that define today’s San Francisco, where the revved-up tech economy and dearth of housing have driven the median price of a one-bedroom apartment to $4,000 a month.

The Los Angeles Times contributed to this report.