LOS ANGELES (AP) — The City Council on Wednesday voted to legalize urban beekeeping, overturning a ban dating to 1879 and overriding concerns that it might bring aggressive Africanized hives to backyards.

"To bee or not to bee, that is the question. But there is no question. We must have bees," Councilman Paul Koretz said before the unanimous vote.

Mayor Eric Garcetti's office said he will sign the ordinance.

That means the nation's second-largest city will join New York, San Francisco and others that permit beekeeping within their borders.

The city has many hives already — some illegal and some wild. Some estimates put the number of wild hives at 10 per square mile.

Feral hives that are discovered in public areas usually are wiped out because of worries that they might contain Africanized bees — hybrids of tamer European honeybees and a hardier but more aggressive strain.

However, those who work with them say honeybees typically only attack in defense of their hives — a view shared in a recent city report.

The new ordinance restricts beekeeping to backyards of single-family homes, sets buffer zones and requires beekeepers to keep a water source for the hives. The hobbyists also must register with the Los Angeles County Agricultural Commission.

Some critics were worried that the law lacked sufficient protection for children, some of whom might be allergic to bee stings. "A person can have beehives on their property five feet from a school play yard or five feet from a playing field where kids will be playing soccer, and it also doesn't limit the size of a hive," Marcia Rozelle told KNBC-TV.

Supporters, including illegal beekeepers, argued that the threat is overblown. They said the insects are important pollinators and part of a healthy environment.