California appeared to deliver a pivotal victory to Bernie Sanders on Tuesday night, driven by a coalition of Latinos, young people and liberal voters up and down the state. With 415 pledged delegates, California is by far the biggest prize of Super Tuesday, and Mr Sanders had been banking on a significant win there.

With millions of ballots left to count, it is impossible to know how the delegates will be allocated, and it may not be clear for several days or even weeks. Roughly two-thirds of California delegates are distributed based on congressional districts, with candidates needing at least 15 per cent of the vote to win any delegates.

But with Sanders receiving more than 70 per cent of Latino voters under the age of 30, and about half of Latino voters overall, according to exit polls, his lead over the other candidates looked decisive.

The Associated Press projected Mr Sanders as the winner of the state just minutes after the polls closed, while thousands of voters in Los Angeles County were still in line to cast their ballots because of problems with voting machines.

A new $300m (£232m) voting system caused waits as long as four hours at dozens of polling sites throughout Los Angeles County, including in Westwood, the San Fernando Valley, Los Feliz and the east side of Los Angeles. The sign-in process to check voters against the voting rolls took hours at several sites, and internet issues left many centres with a small fraction of working machines. Lines continued past 10pm at many locations, including several college campuses.

Democratic primaries: Who won where? Show all 27 1 /27 Democratic primaries: Who won where? Democratic primaries: Who won where? Arizona: Biden wins Joe Biden: 39 delegates Bernie Sanders: 28 delegates Getty Democratic primaries: Who won where? Alabama: Biden wins Joe Biden: 41 delegates Bernie Sanders: 7 delegates Michael Bloomberg: 1 delegate Reuters Democratic primaries: Who won where? Arkansas: Biden wins Joe Biden: 17 delegates Bernie Sanders: 9 delegates Michael Bloomberg: 5 delegates AFP/Getty Democratic primaries: Who won where? California: Sanders wins Bernie Sanders: 179 delegates Joe Biden: 127 delegates Michael Bloomberg: 15 delegates Elizabeth Warren: 5 delegates AP Democratic primaries: Who won where? Colorado: Sanders wins Bernie Sanders: 20 delegates Joe Biden: 9 delegates Michael Bloomberg: 9 delegates Elizabeth Warren: 1 delegate AFP/Getty Democratic primaries: Who won where? Florida: Biden wins Joe Biden: 152 delegates Bernie Sanders: 53 delegates Getty Democratic primaries: Who won where? Idaho: Biden wins Joe Biden: 11 delegates Bernie Sanders: 9 delegates EPA Democratic primaries: Who won where? Illinois: Biden wins Joe Biden: 95 delegates Bernie Sanders: 59 delegates AFP Democratic primaries: Who won where? Iowa: Buttigieg wins Pete Buttigieg: 14 delegates Bernie Sanders: 12 delegates Elizabeth Warren: 8 delegates Joe Biden: 6 delegates Amy Klobuchar: 1 delegates Reuters Democratic primaries: Who won where? Maine: Biden wins Joe Biden: 11 delegates Bernie Sanders: 9 delegates Elizabeth Warren: 4 delegates AFP/Getty Democratic primaries: Who won where? Massachussetts: Biden wins Joe Biden: 37 delegates Bernie Sanders: 29 delegates Elizabeth Warren: 25 delegates AP Democratic primaries: Who won where? Michigan: Biden wins Joe Biden: 72 delegates Bernie Sanders: 52 delegates Getty Democratic primaries: Who won where? Minnesota: Biden wins Joe Biden: 38 delegates Bernie Sanders: 27 delegates Elizabeth Warren: 10 delegates Reuters Democratic primaries: Who won where? Mississippi: Biden wins Joe Biden: 34 delegates Bernie Sanders: 2 delegates AFP via Getty Images Democratic primaries: Who won where? Missouri: Biden wins Joe Biden: 44 delegates Bernie Sanders: 24 delegates AP Democratic primaries: Who won where? Nevada: Sanders wins Bernie Sanders: 24 delegates Joe Biden: 9 delegates Reuters Democratic primaries: Who won where? New Hampshire: Sanders/Buttigieg tie Bernie Sanders: 9 delegates Pete Buttigieg: 9 delegates Amy Klobuchar: 6 delegates EPA Democratic primaries: Who won where? North Carolina: Biden wins Joe Biden: 66 delegates Bernie Sanders: 36 delegates Elizabeth Warren: 2 delegates Michael Bloomberg: 2 delegates AFP/Getty Democratic primaries: Who won where? North Dakota: Sanders wins Bernie Sanders: 8 delegates Joe Biden: 6 delegates Getty Democratic primaries: Who won where? Oklahoma: Biden wins Joe Biden: 21 delegates Bernie Sanders: 13 delegates Michael Bloomberg: 2 delegates Elizabeth Warren: 1 delegate Reuters Democratic primaries: Who won where? Florida: Biden wins Joe Biden: 152 delegates Bernie Sanders: 53 delegates Getty Democratic primaries: Who won where? Tennessee: Biden wins Joe Biden: 33 delegates Bernie Sanders: 18 delegates Michael Bloomberg: 10 delegates Elizabeth Warren: 1 delegate Reuters Democratic primaries: Who won where? Texas: Biden wins Joe Biden: 111 delegates Bernie Sanders: 102 delegates Michael Bloomberg: 10 delegates Elizabeth Warren: 5 delegates Reuters Democratic primaries: Who won where? Utah: Sanders wins Bernie Sanders: 12 delegates Joe Biden: 2 delegate Michael Bloomberg: 2 delegates AFP/Getty Democratic primaries: Who won where? Vermont: Sanders wins Bernie Sanders: 11 delegates Joe Biden: 5 delegates AP Democratic primaries: Who won where? Virginia: Biden wins Joe Biden: 66 delegates Bernie Sanders: 31 delegates Elizabeth Warren: 2 delegates AFP/Getty Democratic primaries: Who won where? Washington: Biden wins Joe Biden: 46 delegates Bernie Sanders: 43 delegates AP

More than four million mail-in ballots had been sent in by Tuesday morning, and as many as five million ballots were left to count by Wednesday, according to an analysis from Political Data Inc, a California-research group that closely tracks returns.

Along with Mr Sanders, both former vice-president Joe Biden and Michael Bloomberg, the former New York mayor, seemed likely to receive delegates in the state, based on early returns. Bloomberg had poured $66m (£51m) into television advertising here, far more than any other candidate.

State officials moved up the state’s primary to March this year in an attempt to make California more politically influential when it comes to choosing the Democratic presidential nominee. The change meant that voters saw far more television advertisements: roughly $120m (£93) worth, with the majority coming from Mr Bloomberg.

Several candidates visited parts of the state that have long been ignored in statewide elections, including Bakersfield and Riverside. Still, California never drew the candidates of early-voting states like Iowa or New Hampshire, and most of the candidates relied on national news coverage to gain recognition in the state.

There was a generational split in California, with Sanders winning among voters under 49 (AP)

There was a clear generational split in the state, with Mr Sanders winning among voters under 49. Mr Biden won among older voters, black voters and moderates in California, the same coalition that helped him win several other states on Tuesday.

Mr Sanders appeared to win among voters at all education levels, according to exit polls.

Voters who chose a candidate in the final days sided with Mr Biden by a 10-point margin, those polls showed.

For months, the Sanders campaign focused its efforts in heavily Latino neighbourhoods around the state, from the Coachella Valley and Bakersfield to Santa Ana, as well as in South and East Los Angeles.

For Lorena Vellanowth, Mr Sanders clearly showed a commitment to issues that she believes are important to Latino voters. Ms Vellanowth came to Los Angeles from Mexico as a baby, and her daughter went on to graduate from UCLA and then attend graduate school at the University of Southern California.

But all that success came with a big caveat: her daughter, who works in public administration for the city of Anaheim, is struggling under the weight of almost a half-million dollars in student loans.

“Bigger than my mortgage,” said Ms Vellanowth, 43, who works in health care. She said her daughter is getting married this month, and she worries about how her daughter and husband will ever be able to afford to have children or buy a home.

That reason alone was enough to draw her, and many of her family members and friends in the Latino community in Los Angeles to Sanders, attracted, she said, by his message of fighting the type of inequality they feel every day.

In California, which has the fifth-largest economy in the world but is also home to the highest poverty rate in the nation when housing costs are factored in, wealth inequality has been a paramount political issue driving voters to the polls.

With such a wealth chasm as a backdrop, Mr Sanders’ platform of “Medicare for All”, free college tuition and student loan relief has resonated deeply. He has also promised to protect so-called dreamers – immigrants who arrived in the country illegally as children – and roll back the Trump administration’s executive orders on immigration.

It’s not only California’s poor and working class who have supported Sanders; some who may not struggle financially have been moved by the stark inequality they see every day.

“He’s the one who seems like he’s most likely to improve the quality of life for the average person,” said Michael Lussier, 29, who works in real estate.

Mr Lussier lives in downtown Los Angeles, which has been engulfed by a worsening homeless crisis. “Living so close to all that makes it harder to vote for anyone who will perpetuate the status quo,” he said.