LOS ANGELES, May 7 — In Paramount Pictures’ adaptation of the television series Baywatch, Dwayne Johnson portrays a hard-charging beach lifeguard with an unsanctioned sideline — murder investigations, undercover surveillance and drug enforcement; he feels it’s his duty to “protect the bay at all costs.”

Zac Efron, as an upstart junior lifeguard in this US$87 million (RM377.5 million) film (due May 25), finds it all a bit much. “I thought that we prevent people from getting sunburned and occasionally stop them from drowning,” he says. “Everything that you are talking about sounds like a really entertaining but very far-fetched TV show.”

Arriving after a protracted development process as one of summer’s most anticipated potential blockbusters, the R-rated action-comedy skewers and celebrates the signature elements that made Baywatch one of the most-watched shows in broadcast history: namely, sun-soaked drama, hunks wearing trunks, slow-mo running montages and beach babes squeezed into government-issue red swimsuits.

But according to Douglas Schwartz and Michael Berk, co-creators of Baywatch who also serve as producers on the movie, the television show suffered a succession of near wipeouts — including a sex-tape scandal involving the breakout star Pamela Anderson — that threatened to upend the syndicated series before it could crest a wave of mid-'90s popularity, reaching a weekly audience of 1.1 billion in 142 countries.

“The odds were against us,” Berk said. “Network executives didn’t think there was a series there. ‘How many times can lifeguards run out and do CPR?’ We got cancelled. You don’t come back from cancellation! So we created first-run syndication just to survive.”

Debuting on NBC in 1989, Baywatch 1.0 belly-flopped with critics and ranked 74th out of 111 shows airing at the time. Worse, the series — a relatively gritty procedural drama starring David Hasselhoff of Knight Rider fame, Playboy Playmate Erika Eleniak and Parker Stevenson, of The Hardy Boys — was cancelled after a single season because GTG, the studio backing Baywatch, went out of business.

But a curious thing happened on the way to prime-time oblivion. Berk and Schwartz are first cousins who had worked together on TV projects as far back as 1958 (they shot their first as kids). Although they had regrouped after the failure of Baywatch, setting up new pilots at different networks, their uncle Sherwood Schwartz — the syndication savant behind sitcoms like The Brady Bunch and Gilligan’s Island — gave them crucial advice. “Uncle Sherwood said, ‘This is your Gilligan’s Island,’” Schwartz recalled. “'Don’t blow it! Go and buy back your rights.'”

The two made a deal with the GTG boss Grant Tinker to reacquire worldwide rights to Baywatch for US$10. “He laughed and accepted it,” Schwartz said. “If we weren’t successful at the end of that year, they got Baywatch back. If we were successful, they got US$5,000 an episode.”

The show had quietly taken off in Europe after cancellation. Production money was cobbled together from overseas distributors, and in 1991 Baywatch was sold into first-run syndication: A kind of ad hoc programming deal dividing broadcast rights among multiple stations rather than allocating them to a single network. But less money upfront meant the showrunners had to slash the production budget by one-third. And several of the original cast members either quit or were fired.

Seeking a replacement for Eleniak’s popular character during the show’s second season in syndication, the showrunners (among them, Gregory Bonann, the third co-creator of Baywatch), and Hasselhoff auditioned Anderson, another Playboy Playmate, then appearing on the hit ABC comedy Home Improvement.

Almost immediately, Hasselhoff (who had deferred part of his salary to become an executive producer) voiced his objections.

“She’s wearing a vest where you can see her breasts on the side,” Hasselhoff recalled. “I said, ‘I don’t want anybody from Playboy. This is a family show.'”

Berk said, “He was afraid Pam and her breasts would upstage him,” adding that she did.

“I never worried about that,” Hasselhoff said, adding, “But she just oozed charisma. I walked out of the room and said, ‘I’ve changed my mind. Hire her.’ And we hired her on the spot.” (Anderson declined through a spokeswoman to be interviewed for this article.)

As Baywatch began to take off, the show became singularly identified with its frothy visuals: Surf spray licking against lifeguards’ tanned and toned physiques. In another of the show’s defining ironies, partial credit for that motif goes to Schwartz, who directed more than 40 episodes despite a diagnosis of retinitis pigmentosa that means he is legally blind.

“My vision is 10 degrees; most people see 180 degrees,” Schwartz said. “But everything I could see was in-camera.”

Baywatch remained popular throughout the ‘90s, prompting spinoffs (Baywatch Nights, Baywatch Hawaii) before coming to an end in 2001.

In 2004, movie rights went to DreamWorks and were later transferred to Paramount. Over the years, development executives cycled through different scripts, struggling to establish a funny yet faithful tone. The project finally got the green light in 2014 with the casting of Dwayne Johnson, who had just appeared in the US$788 million-grossing Fast & Furious 6. But in true Baywatch fashion, when the adaptation was filming its final scene, it faced a nail-biting deadline.

“Universal had Dwayne for The Fate of the Furious, and Paramount had him for our movie,” recalled another Baywatch producer, Michelle Berk (who is married to Michael Berk). She explained, “We had one night to shoot him and one take. A plane was waiting for him to get him to the set of Fast.”

To hear it from Berk, though, that additional pressure resulted in “incredible energy” on set that only enhanced the finished film. “Because of the luck and karma of Baywatch, every failure and every creative gamble has led to greater benefits,” he said. “It’s a Buddhist principal: Turning poison into medicine.” — The New York Times