(CNN) Crowds descended on California beaches, hiking trails and parks over the weekend in open defiance of a state order to shelter in place and avoid close contact with others.

People are seen on the beach on March 21, 2020 in Huntington Beach, California.

Instead, many public spaces were packed, prompting officials in some cities to order parks, recreation areas and beaches to close.

'People packing beaches'

Video and photos on social media showed groups of people standing in close contact of one another at popular hiking trails and beaches in Los Angeles over the weekend. Health officials urge people to maintain a distance of 6 feet from one another to prevent transmission of the highly contagious virus.

A bike path in Huntington Beach, California was packed Saturday despite a shelter in place order from the Governor.

In response to the crowds, Los Angeles Mayor Eric Garcetti announced on Twitter late Sunday that he was closing sports and recreation at all LA City Parks. He also tweeted that parking at city beaches was closed.

"This weekend we saw too many people packing beaches, trails and parks," the Mayor tweeted. He said people should heed the closures and stay home. "That doesn't mean gather elsewhere. This is serious. Stay home and save lives."

This weekend we saw too many people packing beaches, trails and parks. So we are closing sports and recreation at @LACityParks and closing parking at city beaches. That doesn't mean gather elsewhere. This is serious. Stay home and save lives. — Mayor Eric Garcetti (@MayorOfLA) March 23, 2020

Garcetti told CNN affiliate KTLA that he was working with officials in neighboring cities and the county to address large crowds at beaches.

Meanwhile, the city of Santa Monica closed its beach parking Sunday to deter people from flocking to the beach.

Further south, the city of Long Beach closed many of its recreation facilities. On Sunday night, Long Beach Mayor Robert Garcia said in a tweet that the city had closed skate parks, dog parks, playgrounds, picnic areas as well as volleyball, tennis and basketball courts.

The city is trying to discourage people from playing team sports and encourage them to maintain a social distance of 6 feet when utilizing city facilities.

Garcia tweeted that the city is also looking to establish additional guidance for the use of its beaches.

He said the onus is on residents to comply with the rules as public safety teams may not be able to enforce the orders.

To be clear, the Governor and City's order does allow people to go for a walk or visit a park or beach. However, you must still use social distancing. You can't play team sports, and you must stay 6 feet apart from anyone else. — Mayor Robert Garcia (@LongBeachMayor) March 22, 2020

"More signs are going up at beaches and courts, and we will look to enforce more -- but our public safety teams are incredibly busy," Garcia tweeted. "We need the public to take self responsibility and remember that our doctors, nurses and medical personnel are counting on us."

California wasn't the only place where people ignored orders to stay home and maintain social distance.

Beaches closed and boating banned in Florida

This weekend several videos showed large groups of people partying on boats and tying their water crafts together in the Biscayne Bay of Miami and outside Boca Raton.

While Lake Boca Raton has always served as a social gathering spot for many boaters, and will again, now is not the time for parties and tie ups on the water. Please be patient, and do your part, so we can all get through this together.

1/4 pic.twitter.com/ubvgDn4UTl — City of Boca Raton (@CityBocaRaton) March 22, 2020

The city of Boca Raton tweeted images of crowded boat parties and discouraged residents from gathering on the water.

Miami-Dade County Mayor Carlos Gimenez closed marinas and boat ramps in the county Sunday to prevent people from going out to sea to hang out.

Tougher restrictions on boat ramps and marinas are now in place in addition to the other steps Miami-Dade is taking to combat new cases of COVID-19. As of this writing 177 cases had been confirmed in Miami-Dade County. Here is today's update: https://t.co/n1giPmYfaR — Mayor Carlos A. Gimenez (@MayorGimenez) March 22, 2020

"I am disappointed to see photos and videos on social media of boats close together and large groups of people congregating," Gimenez said in a news release Sunday. "We are in a state of emergency, and I cannot stress enough the need for personal responsibility."

Beaches throughout Florida closed for the weekend to prevent spring breakers and residents from gathering on the beach.

On Friday, several beaches in the state closed to the public and hotels in Miami-Dade County were ordered to vacate by Monday night.

The mayor said the Miami-Dade Police Department will be out on the water "ramping up enforcement" of the no rafting order issued by the mayor on Friday to prevent large gatherings and parties on boats.

Park closures around the country

Parks from coast to coast were closed by local authorities over the weekend in an effort to stem the spread of coronavirus.

Oregon State Parks announced on Facebook Sunday that all state parks would be closed until at least May 8.

The National Park Service has closed some locations and is keeping others open when possible, according to its website. The Park Service also waived entrance fees to help visitors maintain social distance.