LOS ANGELES – As a fast-growing wildfire scorched a corner of Simi Valley, California, flames came within a few feet of the Ronald Reagan Presidential Library, and an unlikely hero may have saved the day.

The structure was threatened but undamaged Wednesday morning by the so-called Easy Fire. Goats that grazed on vegetation near the property are partially to thank for why the building remains standing.

In other words, goats are the G.O.A.T.

Library spokeswoman Melissa Giller said the Ventura County Fire Department brings hundreds of goats every May to eat the brush around the perimeter of the library to create a fire break.

"The firefighters on the property said that the fire break really helped them because as the fire was coming up that one hill, all the brush has been cleared, basically," she said.

"It was darn smart for us to do that," John Heubusch, executive director of the Ronald Reagan Presidential Foundation & Institute, said of bringing the goats to the 400-acre complex.

Driven by the Santa Ana winds, the Easy Fire grew quickly and raged over 1,300 acres while threatening 6,500 homes, Ventura County officials said Wednesday.

As the blaze expanded, the flames came within a few feet of the library pavilion holding Reagan's Air Force One, Heubusch said.

California fires updates:Easy Fire rages within 30 yards of Reagan Library as Getty, Kincade blazes continue assault on California

"It was bad news for a few hours," he said. He arrived early and watched as firefighters worked to save the complex, battling from the ground and the air.

Wildfires have bored down on the 400-acre presidential library and museum complex before, but this was the closest call yet, he said.

"What saved this library was those brave helicopter pilots," Heubusch said. "They braved 80-per-mile gusts to put water in that canyon. Gusts like that drove enormous flames up to the library."

While the 260,000-square-foot museum's exhibits were in danger, the most important asset, the presidential papers, are stored in an underground vault-like complex designed to protect them from fire and other catastrophes.

"The closest call this morning was Air Force One," Heubusch said. The building in which it is housed "butts right up against the canyon."

When he arrived at 6 a.m., the landscaping sprinklers were already engaged. At one point, about 50 or 60 fire trucks were on the hilltop fighting the fire and protecting the buildings. Shifting winds helped, too. And, of course, the goats.

"So right now, we are safe," Giller said.

'When I smelled that smoke ... here we go again':Weary Californians seek shelter amid latest wildfire outbreak

The building was built with fire protection in mind. The hilltop complex was fitted with a landscape irrigation system that extends out beyond the normal boundaries of the property.

Also, the building is fully equipped with sprinklers, with some on the roof, said Ben Anderson of the Jacobs Engineering Group in Boston, which acquired the architectural firm that designed the library and museum.

The museum and galleries also have fire doors, Giller said.

"So God forbid, if a fire was to breach inside the building, the doors close and traps the fire in that specific gallery," she said. "A fire can't get through those doors."

The Reagan library is home to more than 60 million pages of documents and 1.6 million photographs from the Reagan administration, the library's website says. A half-million feet of motion picture film, tens of thousands of audio and video tapes and over 40,000 artifacts are housed there, too.

The Air Force One, tail number 27000, which flew seven U.S. presidents, sits in a pavilion with other presidential limousines and Secret Service SUVs. A full-size replica of the White House Oval Office is also located on the complex's grounds.

Reagan and his wife, Nancy, are buried next to each other on a hillside at the library.

Haunting wedding photo:Masked newlyweds picture in burning California looks apocalyptic

Residents in the area said the fire spread with speed. Vickie Garza was on her way to work when her husband called to say the hill behind their Simi Valley home was on fire early Wednesday.

She had left about 5:45 a.m. and saw no smoke or flames. By 6 a.m., a neighbor had started honking a car horn to wake people up and let them know something was wrong.

"That's how quickly it came," said Garza, who has lived on Algonquin Drive for around 30 years.

As she headed back, she could see the smoke and fire from Highway 118. The Garzas met up at a Target parking lot where authorities had set up a temporary command post near their neighborhood.

They waited there for their neighbor Jean Erickson, who was trying to get her two cats before leaving.

"All I saw was orange," Erickson said of her view out her front window.

Nearby in Los Angeles County, more than 7,000 homes near the Getty Museum have been evacuated with the Getty Fire raging. In Northern California's Sonoma County, the Kincade Fire also threatened 80,000 homes in wine country, with about 200,000 people evacuated from the area since the fire ignited last week.

Contributing: Cheri Carlson, Ventura County Star; John Bacon, USA TODAY; The Associated Press.