OAKLAND — The temperature was rising, and Khaled Almaghafi was trying to coax 20,000 bees out of a nest while hanging suspended 30 feet above Telegraph Avenue. A construction crew called him the day before to extract a hive that had metastasized into the facade of the former mortuary and temporary methadone clinic. Hive and wood had become one.

“I’m not sure what I’m going to be facing — angry bee or gentle bee,” he said before pulling on a white canvas jacket and netting over his face then climbing into the bucket of a candy-blue Genie scissor lift.

Only a few years ago the construction crew renovating the building might have hired an exterminator instead of Almaghafi to handle the bees. But the highly publicized decline in bee numbers made the foreman decide otherwise. That coupled with the slow food, locavore movement has produced a wave of bee love. Oakland is no exception. Backyards and roofs are being turned into urban havens for the honeybee and its native cousin.

Some urban beekeepers are motivated by honey. But Almaghafi said he sells beehive kits, which start at $100, to people who “just care about the bees.” Beekeeping used to take some convincing. Now, he said, “A lot of people are getting involved. They want to save the bees.” Everyone from teenagers to Mercedes-driving businessmen in suits come to his Telegraph Avenue store, Bee Healthy Honey Shop, for the hives, as well as beekeeping advice. “People have a pet mentality about bees,” said Ariella Moses, who works at the store. “They like to make nice homes for them.”

Yolanda Burrell also sells beekeeping supplies at the Pollinate Farm & Garden store in Oakland’s Fruitvale district. People are increasingly taking the quality and source of the food they eat into their own hands, Burrell said. “And part of that is beekeeping.”

Honey is one of the few crops city dwellers can produce with relatively little space, making urban beekeeping an attractive, and potentially lucrative, foray into the local, organic food movement.

Catherine Edwards labels the honey she sells from her 25 hives “Richmond Gold.” Even the swank Fairmont Hotels and Resorts chain installed rooftop honeybee gardens in nearly a dozen locations including San Jose and San Francisco, where 200,000 honeybees living in four hives produce about 600 pounds of honey per year.

The telltale signs of an urban beekeeper usually include 16-by-20-inch boxes, often painted white, and a cloud of bees darting overhead on warm days. Most of them are European honeybees, first brought by colonists to North America in the 17th century along with apple trees and other flora and fauna previously unknown to this continent. Now Americans eat more honey than anyone else on the planet — 1.3 pounds per year per person, according to the National Honey Board. And the amount of people who bought honey increased to 75 percent in 2013, compared with 61 percent the year before.

The nation’s agriculture industry also depends on them. Burrell said bees pollinate a third of the food we eat. Another way to think of it is that 1 in 3 bites of food we take was pollinated by a bee. Farmers in places like the Central Valley pay commercial beekeepers top dollar to truck in bees, often from out of state, to pollinate crops.

Almaghafi was one of those commercial agribusiness pollinators. His father was a beekeeper in Yemen and introduced modular beehives to the country in the 1950s. Almaghafi opened his store in Oakland about six years ago. But nothing prepared the second-generation beekeeper for the massive die-offs of his bees that began in 2007. He went from 350 to 70 hives. The culprit was colony collapse disorder. Scientists are still trying to figure out what causes it. But in a lineup of suspected reasons, most beekeepers would point to chemical pesticides.

Whole colonies simply disappeared, leaving behind honey, pollen, larvae and pupae. It’s very unusual behavior for honeybees. They are the only insect known to live in permanent colonies, said David Eichorn, a 40-year beekeeper who lives in Kensington. But swarms do set off when the hive gets too crowded and form new colonies. That day a swarm of about 15,000 had marched in to Eichorn’s backyard. Within a half-hour they were setting up home in a hive he had set out to lure them. He wanted to replace the bees he lost over the winter to mostly parasitic mites — the bane of backyard beekeepers like him. “Come on girls,” he said, gently nudging a few errant ones into a hive.

Native bees, of which there are 4,000 species, from the bumblebee to the southeastern blueberry bee, are even more efficient pollinators than their imported cousins, said Jaime Pawelek, a researcher with the UC Berkeley native bee lab. Their numbers are also shrinking. “There are so many things that can thrive in an urban habitat,” Pawelek said. “But they need to be protected.”

Which is why the Alameda County Beekeepers Association runs a hotline to match beekeepers with bees that have swarmed into the wrong yard or have to be extracted from buildings.

“A lot of bees are destroyed just because of fear,” said Bob Baty, who said his first batch of Oakland-grown honey several years ago won first place at the Alameda County Fair.

When the bees swarm off to make a new hive they are full of honey, so it’s harder for them to sting. Without a hive to defend they’re also less likely to want to sting, although Alameda beekeeper Andre Kruglikov has learned the hard way that they will still do so if provoked. Bees are fascinating and “a little bit scary,” Kruglikov said. “It gives you a good topic of conversation.”

"There is a general recognition that we don't need these military-style weapons in New Zealand, so it's very easy to win cross-party support for this," said Mark Mitchell, who was defense minister in the previous, center-right government and who supports the ban initiated by the center-left-led Labour Party.