Pepperdine University’s 3,600 undergraduates were ordered to shelter in place Friday as a wildfire closed in on the Malibu campus. The Woolsey fire has forced evacuations, but Pepperdine students were urged to shelter in one of two buildings on campus — a decision that frightened some parents and students despite reassurances from the university that it was advised by fire officials.

Shortly after midnight local time Saturday morning, the university alerted campus that there were flames on the hillsides. “Pepperdine’s shelter-in-place protocols remain in place. Multiple L.A. County fire department strike teams and fire department air operations are engaging the fire from campus.” Just before 2 a.m., the school announced, “Los Angeles County Fire strike teams and air operations are working to contain the flames on and around the Malibu campus. No permanent structures have been lost.”

A few minutes after 8 a.m., the university lifted the shelter-in-place order. “Flames on hillsides near campus were extinguished early this morning,” university officials announced to campus, “although spot fires may appear and should be reported to Public Safety.” All classes were canceled.

Overnight, debate raged over whether the students were in the safest possible spot — or trapped.

Someone else wrote on Twitter, “that’s a hell of a risk #Pepperdine have taken,” not to evacuate students.

Some students left campus despite the shelter-in-place order. Alanah Jimenez, a freshman, said she was hearing from friends who were trapped in traffic, watching plumes of smoke rising behind them and wondering if they would get out in time.

Many people were reassuring worried parents and students that the campus was well prepared for this type of threat, with huge tanks full of water and students sheltered far from the burning chaparral, or shrub land. Jimenez said school officials had been quick to help. “I am grateful to Pepperdine,” she said.

It seems counterintuitive, said Connie Horton, the vice president for student affairs, but the Los Angeles County Fire Department supports the shelter-in-place plan as the safest course. “We have lived it a number of times over the years, practiced it, rehearsed it, trained on it."

The university has followed the same procedure since 1993, according to a social media message from the school’s president.

Campus buildings are constructed with fire-resistant materials, according to the university website explaining the practice. School roads provide fire breaks, brush is cleared every year to 200 feet or more from buildings, and with a limited number of ways on and off campus, roads can quickly become congested and dangerous as wildfires shift unpredictably.

It can be confusing for parents and students when evacuation orders are issued in the community, Horton said Friday, so they had several people taking phone calls to reassure families.

She watched “the migration” to the shelter sites, with students holding pillows and bags, and finding a spot to settle in. “It shifts from a moment of anxiety to a slumber party. They’re hanging out, taking a nap, going to their books.”

That was before the fire closed in.

Madeleine Carr, a junior who is the news editor for the Pepperdine University Graphic, the campus paper, said that early on someone was playing piano and people were singing along to songs such as “Bohemian Rhapsody” and “Don’t Stop Believin',” setting up tents and reading aloud from a Harry Potter book. “People were trying to distract themselves or keep the tone light.”

University staff handed out ice cream at 10 p.m. and people tried to go to sleep, but the floor was hard, helicopters were thundering overhead, and face masks made breathing hot and uncomfortable, Carr said.

There was a bright glow in the west that wasn’t the sunset. And then there were flames coursing down the hill toward campus. It was wildly different from seeing a fire on TV, Carr said, especially as the air inside began to smell like a campfire.

Carr realized that her backup plan — running to her car to get away — would mean running toward the fire.

It was terrifying, and eerily beautiful. “People kept saying, ‘It’s weirdly pretty — I can’t stop watching it,’” she said.

The Los Angeles Times reported that firefighters “staged an all-out fight overnight to save Pepperdine” and that the intense attack by air and on the ground appeared to have prevented any major damage.

A spokesman for Cal Fire said Saturday he could not confirm what had happened at the campus overnight.

A university spokeswoman and student government leaders did not immediately respond to messages seeking comment Saturday.

It has been an emotionally wrenching and exhausting series of days for the private Christian university: On Wednesday night, people at Pepperdine were trying to find and help students who were at the Borderline Bar & Grill in nearby Thousand Oaks when a gunman opened fire, killing 12. On Thursday, they were gathering to grieve for Alaina Housley, an 18-year-old freshman who was one of the shooting victims.

And then the fire closed in.

It was almost hard to believe, Jimenez said. “All this devastation in such a little amount of time has taken a toll on everybody. … I feel empty.”

On Saturday morning, when they were allowed to go back to their dorms, she saw the scorched areas, black marks on some buildings and smoke still rising in a few places.

University officials closed the Malibu and Calabasas campuses and canceled all events through Tuesday.

But by midday Saturday, Pepperdine’s president, Andrew Benton, was able to reassure the campus: Everyone was safe.