California's extreme drought is gobbling up yet another victim: The state's trees.

On Friday, Gov. Jerry Brown declared a state of emergency over "epidemic infestations" of bark beetles.

The beetles kill the trees, which makes everything from erosion to wildfires worse. Californians even face "safety risks" from falling trees, the governor's office warned.

In a letter to the Department of Agriculture, Brown adds that the state is "facing the worst epidemic of tree mortality in modern history."

Rick Bowmer / AP

Spruce bark beetles are seen in 2009 in Canada.

The drought is creating "a bark beetle piñata."

The insect is native to the western U.S. and feeds on various kinds of trees. Under normal conditions — i.e. when there is plenty of water — the beetles play a natural role in renewing the forest, with tree sap protecting trees from excessive die-offs.

A National Interagency Fire graphic shows that the number of acres burned this year in Northern California — represented by the blue line — far exceeded average and normal conditions, represented by the dotted line and the gray region, respectively.

The drought-related bark beetle infestations make these wildfires worse by creating more dry fuel that builds up over time.

"That's why the fire season has been so horrendous," Patzert said. "All these dead trees burn fast and furious."

In addition to future fires, the drought and related bark beetle problems are pushing healthier forests to higher elevations. Patzert said that while it isn't an "apocalypse," it is a significant change.

David Mcnew / Getty Images

A fire burns near San Andreas, California, on Sept. 13.

Millions upon millions upon millions of trees have been killed so far.

The U.S. Forest Service estimates that there are 22 million dead trees in California alone, and a spokesman for the agency told BuzzFeed News that number is likely to rise.

The dead trees are spread out across 45 million acres that the Forest Service has surveyed so far. Across the entire region, that number is likely even higher.

Patzert estimated that there could be 30 million dead trees across the West, and if Canada is included, the estimates become even more alarming.