The sudden appearance of buzzing insects around Brian Hildebidle’s feet as he surveyed a dune restoration project in the Presidio last week startled him and prompted alarming visions of volunteer workers fleeing from angry yellow jackets.

The stewardship coordinator for the Presidio Trust was about to run when he noticed the insects were a grayish color and swirling in a strange pattern close to the ground.

“I was really curious because I had never seen that flying pattern,” said Hildebidle, who leads volunteers on weekly weed-pulling and planting expeditions and is quite familiar with the park’s bug denizens.

The insects, which he said numbered in the hundreds, turned out to be silver digger bees, a rare sand-loving species that had not been seen in San Francisco in significant numbers for the better part of a century.

“I went from fear to ‘wow, this is kind of cool,’” Hildebidle said. “Most of the news around bees seems to be about colony collapse or bees, in general, in decline, so maybe this is a small victory.”

The discovery of a thriving native bee colony on the western side of the Presidio is actually no small victory for San Francisco, which was once a sweeping panorama of open sand dunes. It is, experts say, the latest example of how the removal of invasive plants and the restoration of dunes and grasses at the former military base have helped bring back lost species that had thrived for tens of thousands of years in the coastal habitat before the city was built.

“It’s just another testament of several over the last decade of the restoration work that’s going on here,” said Jonathan Young, a wildlife ecologist for the Presidio Trust. “We’ve put in 18 years working at that site. People want instant gratification, but ecological gratification takes a long time. Now we are seeing the fruits of our labor.”

Besides bees, several species of insects, birds, frogs, mammals and dozens of plants have returned after long absences and are thriving in the Presidio.

The bees, known scientifically as Habropoda miserabilis, were probably common in San Francisco as late as the 1920s, said Leslie Saul-Gershenz, an entomologist and researcher for the John Muir Institute of the Environment at UC Davis.

She said they began to disappear as the vast coastal prairie on the western side of the city was paved over for development and were all but gone by the mid-20th century. Although silver digger bees exist in other places, like the Oregon coast and the Mojave Desert, only a couple of specimens have been found in San Francisco since 1960.

In the Presidio, non-native ivy, eucalyptus and ice plants covered the sand and choked out native plants, removing crucial habitat for the bees. Saul-Gershenz said she collected a digger bee specimen near Baker Beach in 1998, but nobody has seen a large aggregation of the species for many decades.

“I was so happy. It’s like seeing an old friend,” she said after confirming for Hildebidle and Young that the bees were indeed silver digger bees. “I have been looking for that bee in San Francisco for I don’t know how long. It’s really heartwarming.”

Silver digger bees are larger than honey bees and fly faster. They pollinate numerous native plants — the ones in the Presidio seem to prefer blue lupine species — but Saul-Gershenz said it is their mating habits that are most fascinating.

The female bees, which are larger than the males and have longer back legs for digging, build burrows in the sand 20 to 30 inches deep, each carrying a single egg. They collect pollen and nectar on their fuzzy hind legs and feed their larval offspring between March and May. The mothers die after about 2½ months without ever meeting their children.

The male babies emerge first, libidos firing on all cylinders, and immediately begin flying over the sandy burrows searching for females to impregnate. When the females come out they are immediately set upon by eight to 10 males, what Saul-Gershenz called a “mating ball.”

“It’s a scramble competition and the one male that’s the fastest and the strongest gets to the bottom,” Saul-Gershenz said. “That’s why the males are flying close to the ground.”

The females can sting, she said, but digger bees are not aggressive because they do not have a hive to defend. The males, which have distinctive white patches on their faces, do not even have stingers. The feverish males calm down at night and sleep snuggled together on plants.

It is believed that colonies of silver bees will stick to the same nesting area for decades, even centuries, if the conditions are right.

Silver bees have made a comeback, after being nearly wiped out, in several other areas in California, including Bodega Marine Reserve in Bodega Bay and Lanphere Dunes in the Humboldt Bay National Wildlife Refuge after both places were restored.

But the Presidio has been a model for habitat restoration and species recovery since 1994, when the U.S. military turned the land over to the National Park Service and created the Presidio Trust to oversee 80 percent of the park.

Mountain Lake, once a filthy pond teeming with invasive species, has been restored as close as possible to its natural state, with three-spined sticklebacks, western pond turtles, chorus frogs and other native species.

Invasive trees and plants, culverts, decrepit buildings, dump sites and military detritus have been removed over the past two decades. Wetlands have been restored and underground springs and creeks have been rerouted from culverts to the surface. Sand dunes and coastal habitat off Battery Caulfield Road, on the southern edge of the Presidio, have been completely restored, as were dunes near Baker Beach.

As a result, rare plants have been poking up on grasslands, hillsides and beaches. Biologists have reported a more than tenfold increase in the number of native plants in the Presidio, including at least four that are federally listed endangered or threatened, among them the Presidio clarkia.

The Franciscan manzanita, which was believed to be extinct in the wild, was discovered in the Presidio in 2009. It was the first of its kind seen in its native San Francisco since the old Laurel Hill Cemetery was bulldozed in 1947 and paved over for homes.

Thousands of grasses and flowers uniquely adapted to San Francisco’s natural sand dunes have been planted, most notably the federally endangered San Francisco Lessingia.

Butterflies, hummingbirds, coyotes, a large population of native western chorus frogs and now the bees have since shown up.

Saul-Gershenz said the return of native bees could be a bonanza for scientists, who collectively know very little about the biology, population or distribution of California’s 1,600 native bee species. Nothing at all is known about the nesting, biology or floral habits of 30 percent of the 589 native bees found recently in the Mojave Desert, she said.

“That’s why it’s important to study them and protect the habitats they live in now, because they may be the bees we need to pollinate in the future,” she said. “This native bee is unique in how it has these relationships with certain native plants, which also support other native species, like butterflies, which in turn support birds. These things are all connected and the bees are an indicator species of the health of our ecosystem.”

Peter Fimrite is a San Francisco Chronicle staff writer. Email: pfimrite@sfchronicle.com Twitter: @pfimrite