Last week was painful for California, with daily deaths reaching a record of 115 on Wednesday. On that day, more than half the deaths — 66 — were recorded in Los Angeles County.

That’s a reflection of the difficulties Los Angeles has faced during the pandemic. Los Angeles County accounts for just over a quarter of the state’s population, but it has nearly half of California’s confirmed coronavirus cases (19,528 out of 43,645 statewide) and more than half the deaths (913 out of 1,717).

Cases and death tolls leveled off in the Bay Area at a much lower rate, even accounting for the smaller population. The nine counties that make up the Bay Area account for 19% of the state’s population but only 17% of California cases and 15% of statewide deaths.

A key factor, experts say, was the Bay Area’s early shutdown, though this may not fully explain the different trajectories.

San Francisco and five other Bay Area counties issued aggressive public health measures on March 16, effective the next day, which permitted only essential businesses to operate on their physical premises. Los Angeles County was slower to fully shut down, though it too was ramping up distancing measures. On March 15, the Los Angeles mayor ordered many bars, clubs, and other businesses such as gyms and bowling alleys to close, and barred dine-in service at restaurants. But some activities could still continue. On March 19, Los Angeles County barred gatherings of 10 or more people and ordered shopping malls and other nonessential retail closed — the same day Gov. Gavin Newsom shut down the whole state.

“San Francisco certainly acted faster and more aggressively,” said Robert Siegel, an infectious disease expert at Stanford. “I think that’s a key factor. It would mean San Francisco succeeded in spreading out the curve.”

A Los Angeles County representative told The Chronicle that the virus had become the leading cause of death locally, with the daily toll far higher than flu or heart disease.

“Because we are still seeing a significant increase in new cases and deaths, we ask that you continue to stay home as much as possible,” Barbara Ferrer, the county director of public health, said in a statement Saturday. Hospitalizations have risen slowly over the past week in Los Angeles County — 1,845 people were hospitalized with confirmed cases as of Saturday, up from 1,709 a week earlier — while those in the Bay Area have begun declining (369 Saturday, versus 391 a week earlier).

Los Angeles County has 10 million people, compared with the Bay Area’s 7.7 million.

Lee Riley, an infectious disease expert at UC Berkeley, said there “could be several possibilities” causing the divergence of fates between San Francisco and Los Angeles.

“In any given region, if we say that 10% of the population isn’t complying with public health directives, places with more people will see more cases,” he said.

The virus may be spread among and by people who may not be able to observe social distancing by virtue of their work, like first responders, health care workers and people involved in essential businesses, like grocery store workers, Riley said. It could then be spreading to family members of these groups, he said.

Almost 40% of COVID-19 deaths in Los Angeles County were in institutional settings — in nursing homes and assisted-living facilities, county Department of Public Health Department records show.

The county cleared a large backlog of tests last week, leading to a surge in the number of positive results. The county’s number of new cases was down significantly on Saturday and Sunday, however, and just 18 deaths were reported Sunday — a far cry from the county’s record high of 81 deaths on April 18. But it is unclear whether weekends may bring lower numbers.

Shwanika Narayan is a San Francisco Chronicle staff writer. Email: shwanika.narayan@sfchronicle.com Twitter: @shwanika