On Easter Sunday, singer John Legend starred in the latest iteration of “Jesus Christ Superstar,” a live production on NBC that drew legions of viewers thrilled by the music and, of course, the power of the story.

The rock opera is one of the most frequently staged productions in history, but when it debuted on Broadway in 1973, many Christians, Jews – and even the composer – hated it.

Opening night “was probably the worst night of my life. It was a vulgar travesty,” Andrew Lloyd Webber said later.

It didn’t start out that way. As a teen in London, Webber, already an aspiring musical-theater composer, was introduced to budding lyricist Tim Rice. Their first collaboration, a musical about the founder of an orphanage, went nowhere. But their second work, “Joseph and the Amazing Technicolor Dreamcoat” – a retelling of the “coat of many colors” story in the Old Testament – garnered them some attention.

What to do for a follow-up?

“We were toying around with various subjects,” Rice told NPR in 2012, “and I think it was the dean of St. Paul’s Cathedral who said, ‘Why don’t you think about the story of Jesus?’ ”

Rice had long been interested in the story of Jesus’ life, but not exactly in the pious way in which the dean was probably thinking.

“I always thought, if one day I ever became a writer or whatever, that would be a good subject, Judas Iscariot, the story from his point of view,” he said in the documentary “The Making of ‘Jesus Christ Superstar.’ ”

Once the young men had written the rock opera, they struggled to find a theater willing to produce it.

“I mean, every single producer in London said, ‘You have to be joking. This is the worst idea in history,’ ” Webber said in the documentary.

They decided to record the songs and release it as a concept album, using the same record label that had released the Who’s equally conceptual “Tommy” the previous year.

When it came out in 1970, “Jesus Christ Superstar” fizzled in England and was even banned briefly by the BBC for being sacrilegious. But in the United States, it was a smash hit. Suddenly, there was no problem at all finding a producer, albeit across the pond. A stage adaptation was rushed to Broadway the next year, where it set a record at the time for advance ticket sales.

And that’s when the trouble arose. Many Christian leaders thought the modern take on Jesus was pretty groovy – some even incorporated it into Bible study classes – but others condemned it as blasphemy.

Religious critics took issue with the very device Rice thought would make it interesting: the focus on Judas’s point of view. One Baptist preacher told the New York Times it should be called “Judas Superstar.”

Others were scandalized that Jesus was depicted as a “mere man” and that he and Mary Magdalene hinted at more-than-friendly feelings toward one another.

William A. Marra, a professor at Fordham University and a Catholic, told the Times it was “asinine” for Catholics to permit “Jesus to be blasphemed.”

Jewish leaders also expressed alarm that the musical made it appear as though Jews were responsible for Jesus’ crucifixion, which they feared would rekindle anti-Semitism.

In fact, some Catholics, Protestants and Jews banded together as picketers, protesting outside the theater for days after the play opened.

Once Webber saw director Tom O’Horgon’s flashy production, which featured a bold, multiethnic cast, a large special-effects “chrysalis” and even a drag queen playing King Herod, he may have wanted to join the picketers.

Despite this being 23-year-old Webber’s first musical, he found it difficult to disguise his unhappiness with it. Here’s how the Times’ Guy Flatley described the scene when he asked Webber and Rice for a review:

“A gurgling noise comes from somewhere inside Andrew and his mournful brown eyes roll heavenward. ‘That’s a very difficult question to answer,’ he finally says. ‘Let’s just say that we don’t think this production is the definitive one.’ ”

” ‘I enjoyed the show very much,’ Tim says.

” ‘Well, it’s not the way I envisioned it,’ says Andrew. ‘I saw it more as an intimate drama of three or four people.’ ”

” ‘We’re just a couple of English lads and we don’t know Broadway,’ Tim announces. ‘But it does seem to us to be good Broadway entertainment.'”

They flatly denied any anti-Semitism, with Rice exclaiming:

” ‘Norman Jewison, who directed ‘Fiddler on the Roof,’ is going to direct the movie of ‘Superstar’ – in Israel! Now, if anybody could spot anti-Semitism, wouldn’t you think it would be the man who directed ‘Fiddler on the Roof?’ ”

Webber ended up hating the 1973 movie, too.

The Anti-Defamation League renewed its criticism for the premiere of the movie, a spokesman giving the Times this now cringe-inducing quote: “Even the casting is of the most primitive type. Anyone who has ever seen cowboy films knows that the good guys wear white hats and the bad guys wear black. Here the actor portraying Jesus is blond; Judas is black.”

(In the original Broadway production and the film, Judas was played by African American actors Ben Vereen and Carl Anderson, respectively.)

Small protests of “Jesus Christ Superstar” have followed many productions in its 48-year history. But none has gathered into an organized movement; the feared wave of anti-Semitism never materialized. And in 1999, the Vatican officially endorsed it, including a production in its 2000 Jubilee Year celebrations.

On Sunday night, Jesus and Judas were played by black actors – Legend as Christ and Brandon Victor Dixon as his betrayer. Alice Cooper played King Herod.

Webber has been closely involved in rehearsals, increasing the chances he may actually like it.

So far, no one is protesting. Instead, “Jesus Christ Superstar” began trending Twitter.