Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Summer-like weather across much of California drove large crowds to the beaches Saturday despite a statewide stay-at-home order intended to curb the spread of coronavirus.

Temperatures reached into the 80s and 90s in Southern California, where people were swimming in the Pacific and sunbathing on beaches that had previously been closed to discourage large gatherings. Not all were reopened but some counties had eased restrictions while warning people to maintain social distancing.

Newport Beach appears to be pretty crowded, as Southern California is hit by a heat wave. https://t.co/abDlBmkZo0 pic.twitter.com/1DDSjvPhT5 — NBC Los Angeles (@NBCLA) April 25, 2020

"It’s crowded out," said Brian O'Rourke, a lifeguard battalion chief in Newport Beach. "We haven’t had too many issues with [social distancing] as lifeguards. Our primary mission is watching the water. We’ve had dozens of ocean rescues and hundreds of preventative actions."

An estimated 40,000 packed onto Newport Beach on Friday and similar crowds were expected Saturday, The Associated Press reported.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"We've had very good compliance," O'Rourke said. "People are spreading out."

In nearby Huntington Beach, where dozens of residents protested recently against California's stay-at-home order, hundreds of people crammed onto the sand. Some wore masks but social distancing was less apparent.

North of Los Angeles, in Ventura County, families frolicked in the ocean. One visitor told "NBC Nightly News" that people "have to get out" rather than "living in a cave or hole."

People enjoy the beach in Huntington Beach, California, on Saturday during the coronavirus pandemic and a heat wave. APU GOMES / AFP - Getty Images

Beaches in Los Angeles County, the state's largest, remained closed.

Los Angeles Mayor Eric Garcetti implored residents to stay home despite the spring heat wave that drove temperatures in some areas to near 100 degrees midweek.

“There is a direct correlation between what you do this weekend and how long this will take and how many lives we will lose," he said Friday. "If you stay home this weekend, our case numbers will drop, and we will stop the spread of this virus."

Los Angeles Police Department Chief Michel Moore thanked residents in a tweet for choosing to follow the county's directive and keeping beaches clear.

My compliments to our community for staying away from the beaches in LA. From Malibu, Santa Monica, Venice, to Dockweiler - All Clear!! Safer at Home will get us there sooner. pic.twitter.com/wZeJ8G8pDR — Chief Michel Moore (@LAPDChiefMoore) April 25, 2020

California has more than 42,000 coronavirus cases and over 1,600 deaths, according to NBC News counts. While the number of infections has remained significantly lower than several of the hardest hit cities in the Northeast, coronavirus has not disappeared from the state.

The gradual uptick in infections has prompted Gov. Gavin Newsom to maintain the stay-at-home order while governors in other parts of the country are starting to relax theirs.

Last weekend, Florida and South Carolina started reopening beaches for the first time since the coronavirus outbreak started on U.S. soil.