It’s hard to imagine Madonna’s namesake debut album — which came out 35 years ago, on July 27, 1983 — without “Holiday,” the classic party anthem that became her first mainstream hit and has given people all over the world cause to celebrate on the dance floor. But the song almost didn’t happen: It was a last-minute substitute for another track on her first LP.

“Madonna’s album was finished,” says “Holiday” producer and New York DJ legend John “Jellybean” Benitez, who was dating Madonna at the time and had been hired to do some remixes for her. There was just one problem: Madonna found out that a song she had recorded called “Ain’t No Big Deal” had already gone to disco act Barracuda, so the track was no longer an option. “She wasn’t so thrilled about that,” says Benitez.

With the “Madonna” LP then down to just seven songs, a replacement was urgently needed. “And I had a demo of ‘Holiday,’ so I played it for her, and she loved it,” the producer says.

Benitez, who had remixed “tons of records” but had never produced one from scratch, was given a one-week deadline by Madonna’s label, Warner Bros., in February 1983. “They said, ‘If you could have this song done by next Friday, you can make the album.’ I started on Monday and finished on Friday, and we delivered it.”

And deliver it did: After “Everybody” and “Burning Up” failed to make the Billboard Hot 100, “Holiday” became Madonna’s first single to hit that chart, reaching No. 16. The track also became her first No. 1 dance song (as a double-A-side single, with “Lucky Star”).

While “Holiday” jump-started one of the biggest careers in pop history, the tune was written by ex-spouses Curtis Hudson and Lisa Stevens-Crowder for their own group, Pure Energy. “I started out playing that chord progression as a ballad,” recalls Stevens-Crowder of the song’s keyboard inception. “But as I kept playing it over and over for a couple of days, I sped it up. And then Curtis came up with that bass line.”

“The whole song just kind of poured out of me,” says Hudson, who came up with the musical arrangement while writing the uplifting lyrics in response to all of the bad news he was watching on TV. “I was like, ‘Man, what’s going on? We need a holiday or something.’ The melody just came to me. I wrote the lyrics in, like, 30 minutes. That’s why I always think of it as a gift from God.”

But Pure Energy’s label, Prism Records, passed on “Holiday” for them. So Benitez, who knew Pure Energy from their performances at the Fun House club where he was resident DJ, offered to shop the song around. “I originally played it for Mary Wilson from the Supremes,” says Benitez. “She liked it, but she wasn’t in love with it.” Then after also pitching the song to the R&B singer Phyllis Hyman and the disco group the Ritchie Family, Benitez found “Holiday” a home with Madonna.

“We were a little nervous at first,” says Hudson about the then-unknown Material Girl recording “Holiday.” “We were thinking of black artists, so it kind of put a whole different spin on it. But once we met Madonna, I knew she was gonna go somewhere. I just didn’t know to what level.”

Hudson played guitar on the final recording of “Holiday,” cut at Sigma Sound Studios in New York. Madonna herself also got in on the instrumental action, playing the cowbell that kicks in early in the song. “It was just sort of like, ‘You got to play something,’ and it worked,” says Benitez, who also added a piano solo by Fred Zarr toward the end of the six-minute track.

‘[Madonna] captured the soul I put into it, but she added her own flavor.’

Stevens-Crowder — who, as Pure Energy’s lead singer, had done the main vocals on the demo — thought that Madonna made the song her own: “She captured the soul I put into it, but she added her own flavor. She didn’t try to copy it. Madonna did Madonna.”

Because of Madonna’s soulful delivery on “Holiday” and the fact that the song was getting played on black radio, there were those who didn’t realize that the singer was actually white. “Back then, people thought she was black,” says Benitez. “They didn’t know.”

Benitez went on to produce Madonna’s 1985 smash “Crazy for You,” while Hudson also co-wrote “Spotlight,” off Madge’s 1987 remix album “You Can Dance.” It’s the legacy of “Holiday,” though, that truly endures.

“I’ve run into so many people who ‘Holiday’ has had some kind of impact on,” says Hudson. “It defies race, age and all of that stuff.”

Of the song’s iconic status, Benitez says, “It’s amazing to see. Madonna still performs it on her tours, sometimes as an encore. It always gets an amazing reaction. It’s a song that they remember.”

And it’s a song whose message is more relevant than ever, 35 years later. Pointing to “the political climate and crazy things that are going on in this world,” Stevens-Crowder says, “We need a holiday today in 2018.”