Wayside School is way, way weirder than most schools. That’s partly because it’s built vertically — 30 stories, with a classroom on each floor. (Builder error.) And partly because of the students, but mostly because of the teachers, who have been known to wiggle their ears, stick out their tongues and turn kids into apples.

That indelible — and extremely beloved — vision of oddity emerged from the brain of children’s book author Louis Sachar more than 40 years ago. So when Sachar decided to return to the series after a decades-long break, the stakes were high: Could he still conjure that glorious level of weirdness?

“I was a little worried when I started writing it, hoping — would I really be able to keep up with what I had done [all those] years ago?” Sachar, 65, recalled during a recent phone call from his home in Austin. “It was a challenge to see if I still had Wayside School inside me.”

Wayside School Beneath the Cloud of Doom” — the fourth installment in Sachar’s wacky series, and the first in 25 years — came out this week, an unexpected and big-deal surprise from the legendary author. Sachar doesn’t talk about books as he’s working on them, refusing to reveal so much as the topic for fear of “releasing the energy” required to write something good. So when he received early copies of “Cloud of Doom” just ahead of a scheduled talk at an elementary school about a month ago, he took one along and shared a few chapters with the kids. And they laughed. “I always get taken aback when people laugh,” he says. “Even the original Wayside School books, I would lose sight of what was funny.”

Sachar found the inspiration for 1978’s “Sideways Stories From Wayside School” during his senior year at the University of California at Berkeley, when he helped out at a local school for course credit. He would spend the lunch hour playing with the kids, and they called him Louis the Yard Teacher, a nickname he found profoundly amusing. “For me, it was a joy,” he says. “It was great fun.”

Sachar turned that school — Hillside — into Wayside, and the students into Sharie, Todd, Kathy and the other lovable oddballs in their class. (He also inserted his alter ego, Louis the Yard Teacher.) To the best of his knowledge, the kids aren’t aware they inspired the books.

At the time, he was obsessed with absurdist writers and figured that in children’s literature, that style of writing was par for the course. A new student shows up, invisible under a pile of smelly raincoats, and turns out to be a dead rat? Just another day at Wayside! He intended to write one kids’ book but hardly had notions of making a career out of it. Yet since “Sideways Stories” was published, more than 15 million readers have delighted in the zany universe Sachar created — and clamored for more books. He published the second, “Wayside School Is Falling Down,” in 1989, and the third, “Wayside School Gets a Little Stranger,” in 1995. They’re just a sliver of his legacy: Sachar has written more than two dozen books for young readers, including the 1998 novel “Holes,” which won the Newbery Medal and a National Book Award, and most recently, 2015’s “Fuzzy Mud.”

Each Wayside School book contains 30 short, playful chapters about the students in Mrs. Jewls’s class on the 30th floor, all loosely connected by some central theme. “Cloud of Doom” sticks to tradition. Sachar picks up where he left off decades ago: The kids are still weird; the teachers even weirder. No one has aged, and little has changed. Sachar still keeps photos of those Hillside elementary students in his office, and he channeled their frozen-in-time personalities when he decided to return to the series.

“Part of the problem is, I’m feeling more detached than ever from kids, just because I’ve gotten older and my daughter’s grown up,” he says. “But I felt like I could still return to those memories and those kids, even though in real life, they might be in their 50s now. I still had a vision of them, and it was a lot clearer than trying to write about kids growing up today.”

There’s little doubt that he’s still a master of the acerbic irreverence that made his books so beloved. Wordplay, keen observations — it’s all here. “Arithmetic makes my brain numb,” Dameon complains to D.J., who retorts: “That’s why they’re called ‘numb-ers.’ ” The kids strive to collect 1 million nail clippings, Principal Kidswatter remains a buffoon and Louis the Yard Teacher gets stuck at the top of the extra-tall flagpole.

Meanwhile, an ominous cloud inches toward the school, edging the kids into bad moods — Sachar’s lone acknowledgment that, yes, this book was written in modern times. “For me, it was everything from global warming to the election of Donald Trump and my mother’s Alzheimer’s,” he says. “But the book isn’t political, and it’s not depressing — it’s just, that’s where it came from for me. And I turned it into humor.” Indeed, there’s a rainbow-tinted final chapter. So does that mean Sachar is optimistic about the future? “I’m not sure if I feel hopeful or not, but I think it’s important that kids feel hopeful,” he says.

It took Sachar two years to write “Cloud of Doom,” compared with nine months the first time around. He’s slower now, he says, and more deliberate. He’s also busy: The day after this phone interview, Sachar was heading to Houston for a four-day bridge tournament. He travels the country to compete, but don’t assume he’s any good. “I like to think I am,” he says. “But most bridge players think they’re better than they are.”

As Sachar chatted from his office, he mused on how the Wayside School books fit into his life’s work. The memorabilia he displays hints at a storied career: a poster from the time Seattle’s Children’s Theatre staged a production of 1988’s “There’s a Boy in the Girls’ Bathroom,” for example. Nearby, in a separate room, he keeps foreign translations of the Wayside School books; he likes their covers, which are different from the U.S. versions.

The fans who have long demanded more from Wayside School propelled Sachar’s decision to finally return to the series. He’s heard from engaged couples who bonded over their shared love of the series, and adults who are now sharing the books with their own kids. One family at a reading reported that every time they see a freight train with more than 20 cars, they start quacking like ducks — a throwback to Dr. Pickell, Wayside’s counselor. “Dr. Pick-El,” their daughter, a little girl, corrected Sachar, shifting the emphasis to the name’s final syllable.

“And I just loved that,” Sachar says. “To become a tradition in families, it’s really a wonderful feeling.”

Angela Haupt is a freelance writer and full-time health editor in D.C.