By 1978, with the Beatles eight years in his rearview mirror, John Lennon had stopped making music — and found himself vacationing apart from his wife and muse, Yoko Ono. That same year, a group of eclectic misfits from Athens, Ga., who called themselves the B-52s released their first single, “Rock Lobster.”

The song was released 40 years ago this week on a small, now defunct label called DB Records. It was later rerecorded and rereleased as part of the band’s 1979 eponymous debut album on Warner Bros.

It’s a bizarre tune containing nonsensical lyrics and circuslike surf music, but it would prove deeply important to the B-52s (it launched them into stardom) and Lennon (it inspired him to team up with Ono and record the last songs of his life).

The B-52s were a new wave band before new wave was an official genre, and “Rock Lobster” hit the masses like a ton of psychedelic bricks. Delirious sounds pumping out of a Farfisa organ flutter and spin around a droning backbeat. Vocalists Kate Pierson and Cindy Wilson sing “ohh” and “ahh” in their best imitation of fish during the song’s nearly seven-minute run. At the end, Wilson shrieks like a dolphin. There’s more than a little cowbell.

Strangest of all, though, are Fred Schneider’s spoken-sung vocals about a rock lobster — a red, brown or colorful creature that lives among coral reefs in tropical areas — spotted near a beachside party where “everybody had matching towels.”

The lyrics paint a strange picture, with senseless imagery …

We were at a partyHis earlobe fell in the deepSomeone reached in and grabbed it

Chased by a catfishIn flew a sea robinWatch out for that piranhaThere goes a narwhalHere comes a bikini whale

The song’s inspiration? A strange Southern nightclub.

“I went to this disco in Atlanta, Georgia, called 2001. And instead of having a light show and fabulousness, they had a slide show,” Schneider said in an interview with Boom 97.3. “And it was empty, and they showed pictures of puppies, babies and lobsters on a grill, and I thought, okay, ‘Rock Lobster,’ that’s a good title for a song.”

In some ways, the song was a happy accident. The band went to a Chinese restaurant one night “and we had this big ceramic bowl of a rum concoction that was very strong,” Wilson told The Washington Post by phone this week. During a post-dinner jam session, the beginnings of “Rock Lobster” emerged. Wilson said the band knew it was on to something.

“We were just rolling on the floor laughing,” Wilson said. “It just kind of happened by wanting to have a good time. And we kept following that.”

The song launched the outlandish band into the mainstream, becoming its first to hit the Billboard top 100. It didn’t peak until 1980, however, after the B-52s played the song on “Saturday Night Live.”

“Rock Lobster” also revived a career that had stalled. Lennon’s well of post-Beatles inspiration had dried by 1975. Though he often cited Ono as his muse, the two had never put out an entirely collaborative album. That changed when he heard “Rock Lobster” for the first time while on a vacation without Ono.

“I was at a dance club one night in Bermuda. Upstairs, they were playing disco, and downstairs I suddenly heard ‘Rock Lobster’ by the B-52’s for the first time,” Lennon told Rolling Stone in 1980. “It sounds just like Yoko’s music, so I said to meself, ‘It’s time to get out the old ax and wake the wife up!’ ”

That the song reminded Lennon of Ono’s music isn’t surprising. Wilson told The Post that the song was, in part, “a tribute to Yoko.”

“Yoko was such an inspiration for us in the early days,” the song’s co-writer, Keith Strickland, told Spinner. “That’s definitely an homage to Yoko when Cindy [Wilson] does that scream at the end.”

Ono recalled the moment similarly.

“Listening to the B-52’s, John said he realized that my time had come,” she told Songfacts. “So he could record an album by making me an equal partner and we won’t get flak like we used to up to then,”which referred to gossip swirling at the time that Lennon and Ono’s relationship was responsible for the dissolution of the Beatles. Paul McCartney has since denied the rumor.

The two began before he got home from vacation, singing to each other over the phone every day. They wrote an entire album in three weeks.

Those songs became Lennon’s final true album, “Double Fantasy.” The two released it on Nov. 17, 1980 — mere weeks before Lennon was killed on Dec. 8. Some of the songs also appeared on his posthumous release “Milk and Honey.”

“Constipated for five years, and then diarrhea for three weeks,” Lennon told Rolling Stone of the album. All it took was “Rock Lobster.”

Though Lennon was never afforded the chance to record more music, Ono has continued following her experimental musical muse. But she never forgot “Rock Lobster.”

“You guys made John very happy,” she told Pierson in 1992. “It was a beautiful, delightful thing for him.”

Finally, a decade later, she joined the B-52s on stage to perform that famous primal scream.

Travis M. AndrewsTravis M. Andrews is a pop culture writer for The Washington Post. He joined The Post in 2016 as a reporter for Morning Mix. Previously, he was a travel and culture editor for Southern Living magazine and a pop culture and tech contributor for Mashable. Follow