What was intended as a day at the beach for “9-1-1” characters Buck (Oliver Stark) and Christopher (Gavin McHugh) turns into a nightmare Monday night.

That’s when a tidal wave crashes into California’s Santa Monica pier, submerging everything — and everyone — in sight before extending inland for eight blocks. The tsunami’s approach was teased at the end of last week’s season premiere.

As executive producer Tim Minear proved with the series’ previously mounted earthquake episodes, disasters are his stock in trade. The self-proclaimed Irwin Allen of television transported the cast and crew to Rosarita in Baja Calif., where they filmed the flood and rescue scenes in the same tanks used in “Titanic.”

“When you’re in the tank, you’re in 42 inches of ocean water, but it looks like a lot deeper,” Minear tells The Post. “We built Santa Monica streets in the tanks and filmed them to look they were in seven feet of water.” Production designer Giles Masters built the upper halves of houses, streets and even the pier’s yellow ferris wheel to enhance the illusion. “When you flood the tank with 42 inches of water, and you have your actors being pulled down 42 inches of raging rapids, it looks like it’s 7 or 10 feet of flooded street,” Minear says. “The actors are working against the real environment around them and you can’t beat that.”

New to the Ryan Murphy calamity factory this season is boxer Ronda Rousey, who has joined “9-1-1” as recurring character Lena Basko. “We were asking ourselves, ‘Who would be part of a [nearby] different fire crew responding to a call on the pier?’ She should be like a Ronda Rousey — charming, but a badass and a better athlete than all the men,” Minear says. Eventually, Minear’s team decided to approach Rousey herself. “I showed her some of the earthquake footage from last season and she was in,” he says.

Safety divers were in the tanks with the cast; the regular stunt crew was on hand as well. During her first take, Rousey smashed her finger under a boat door. “She didn’t say ouch until after the director said, ‘Cut.’ We sent her to the ER and she came back the next day with a splint on her finger,” Minear says.

Medical problems figure in the script as well. On the day he takes Christopher to the Santa Monica pier, Buck is recovering from a pulmonary embolism, affecting his ability to perform as like a first responder.

“It’s extremely dangerous for him because he’s on blood thinners,” Minear says. “It’s after the water recedes and we get to Episode 3 that things get a little more complicated for Buck.”

In the second part of the tsunami episode, which airs next Monday, the water goes out to sea. People are separated from their loved ones and lost. Additional filming was completed in Pomona, Calif., where a ton of debris was dumped on the streets of one neighborhood for rescue scenes.

“Buck and Christopher are definitely in peril,” Minear says. “There are people to be saved and you can’t save everybody.” He pauses and says, “If the cast thinks that, it might make them behave.”