San Francisco has elected its first female, African-American mayor after a bruising intra-Democrat campaign focused on housing.

Board of Supervisors president London Breed triumphed over former state Sen Mark Leno, with Mr Leno conceding he could not make up a deficit as votes continued to be counted more than a week after the election.

Soaring housing costs and a ubiquitous homeless crisis dominated the race, which was spurred by the sudden death of former mayor Ed Lee. Ms Breed vowed to make building more housing a centerpiece of her agenda.

Inside Slab City, the renegade settlement in the California Desert Show all 9 1 /9 Inside Slab City, the renegade settlement in the California Desert Inside Slab City, the renegade settlement in the California Desert Nearby Salvation Mountain is an "interactive work of art" built by Leonard Knight in the 1980s Ruth Iorio Inside Slab City, the renegade settlement in the California Desert Niland, the nearest town to Slab City, has one store, one restaurant and a row of burnt-out shops for a population of around 1,000 people Ruth Iorio Inside Slab City, the renegade settlement in the California Desert One of the painted trucks at the foot of Salvation Mountain Ruth Iorio Inside Slab City, the renegade settlement in the California Desert Another painted truck at the foot of Salvation Mountain Ruth Iorio Inside Slab City, the renegade settlement in the California Desert Ron, or Salvation Mountain Man as he likes to be known, is one of the caretakers of the interactive mountain at the entrance to Slab City Ruth Iorio Inside Slab City, the renegade settlement in the California Desert George Sisson's California Ponderosa Airbnb accommodation Ruth Iorio Inside Slab City, the renegade settlement in the California Desert Artwork at the California Ponderosa Ruth Iorio Inside Slab City, the renegade settlement in the California Desert Jinxy Bonesaw sings on her banjolin Ruth Iorio Inside Slab City, the renegade settlement in the California Desert Willy Fry, a former California Highway Patrol officer, is now a resident of Slab City, 'the last free place in America'. Ruth Iorio

But the historic nature of Ms Breed’s candidacy lent another dimension to the campaign to lead a city that has long prided itself on diversity and tolerance even as accelerating gentrification drives out residents of colour.

A San Francisco native, Ms Breed rose from an impoverished childhood in public housing to a career in politics. She was first elected to the board of supervisors in 2012 and became the body’s president in 2015.

“No matter where you come from, no matter what you decide to do in life, you can do anything you want to do,” Ms Breed said after he victory. “Never let your circumstances determine your outcome in life.”

Uber gets stuck on stairs in San Francisco

Even if Ms Breed had not prevailed, the outcome would have been historic: Mr Leno was trying to become the first openly gay mayor of a city that has long been a bastion of LGBT life and that was a cradle of the gay rights movement.