The ordinance approved by the city council Tuesday prohibits house-to-house and car-to-car trick-or-treating from taking place on Halloween.
The ordinance also bans spraying shaving cream on others, except those within their home or licensed barbers on their customers. Giving candy, Halloween treats and toys to anyone living outside the household is also not allowed.
"While I know this is disappointing news, especially to our children, we believe this is the responsible approach to protect the health of the community," Beverly Hills Mayor Lester Friedman said in a statement.
RELATED: California health officials urging public to avoid trick or treating on Halloween
Those who don't follow the restrictions will be cited, the city said in a news release. Details regarding fines or other penalties were not disclosed.
The California Department of Public Health has released guidance for how to safely celebrate Halloween and Día de los Muertos during the novel coronavirus pandemic. Most notably, the state "strongly discourages" trick-or-treating.
Dr. Mark Ghaly, California's Health and Human Services Secretary, said this is not a flat out ban on trick-or-treating, but that people should think twice before doing so.