San Francisco Mayor London Breed blasted "reckless" beachgoers celebrating Burning Man in her city after the actual festival, which was supposed to take place in Nevada, was canceled because of the coronavirus pandemic.

"Last night, over 1,000 people crowded on Ocean Beach to celebrate Burning Man," Breed wrote on Twitter on Sunday. "This was absolutely reckless [and] selfish. You are not celebrating. You are putting people's lives at risk. You are putting our progress at risk. No one is immune from spreading the virus."

PROTESTERS GATHER AT SAN FRANCISCO HOME OF NANCY PELOSI, HANG UP HAIR CURLERS AFTER SALON VISIT

Breed closed the Ocean Beach parking lots and said law enforcement would be patrolling the area Sunday night.

"We know people love Burning Man [and] people want to get together this weekend," she said. "But we all need to do our part. Stay home, stay safe."

San Francisco has reported 9,915 coronavirus cases and 86 deaths in a county with a population of more than 880,000 people. Comparatively, further south in San Diego County, more than 40,000 people have contracted coronavirus.

Organizers of the Burning Man Project, the group that brings the annual arts and music festival to northern Nevada's Black Rock Desert, made the announcement that it would be virtual in April.

San Francisco Mayor London Breed speaks during a news conference Jan. 15, 2020. (Photo by Justin Sullivan/Getty Images)

California leaders have warned residents to be careful about spreading the virus while at the beach. In April, California Gov. Gavin Newsom ordered Orange County beaches to close until further notice, saying it was necessary to protect public health.

CLICK HERE TO GET THE FOX NEWS APP

The announcement came days after tens of thousands of people in Orange County packed beaches during a sunny weekend.

Fox News' Melissa Roberto contributed to this report.