The BBC's controversial screening of Jerry Springer: The Opera did not break rules on TV standards, media regulator Ofcom has decided.
Jerry Springer: The Opera attracted about 80,000 complaints
More than 7,940 people complained to Ofcom before the hit stage show was broadcast on BBC Two in January, followed by a further 8,860 afterwards.
"Ofcom recognises that a large number of people were deeply offended by the transmission," the watchdog said.
But it said the show was "an important work and commentary" on modern TV.
The musical depicted figures from the Bible, including Jesus and the Devil, as guests on Springer's combative talk show.
It regularly featured "strong language, violent behaviour and revelations of an extreme or shocking nature", Ofcom said.
The show sparked outrage among some Christian groups and the BBC received 55,000 complaints beforehand with another 8,000 after the broadcast.
In March, the corporation rejected the complaints, saying the artistic significance outweighed any offence.
Ofcom has now backed up that view, examining the musical against 12 sections of its code but deciding there were no breaches.
Ofcom had to balance protection from harmful and offensive material with freedom of expression, the body said.
"Freedom of expression is particularly important in the context of artistic works, beliefs, philosophy and argument."
Most offensive language was "well after" the watershed, clear warnings were given and the offensive section was part of a "dream" sequence, Ofcom said.
"Whilst the show clearly had the potential to offend and indeed the intention to shock, it was set in a very clear context as a comment on modern television," it ruled.
Of the 8,860 complaints made after the broadcast, 4,264 came from Christian broadcaster and publisher Premier Media Group.
"The level was unprecedented for Ofcom or any previous broadcasting regulator and appears to have been the first large-scale internet campaign to Ofcom on any broadcasting issue," it said.
Viewers complained that the swearing was excessive, the opera singled out the Christian faith and the characterisation of religious figures was offensive.
Many highlighted the use of swearwords alongside references to God and Jesus, Eve putting her hand under Jesus' loincloth, the suggestion that Jesus was gay and the re-enactment of the crucifixion.
But it was "a cartoon, full of grotesque images, which challenged the audience's views about morality and the human condition", Ofcom said.
"The production made clear that all the characters in the second act were the product of the fictional Springer's imagination.
"Ofcom did not believe that the characters represented were, in the context of this piece, conveyed as faithful or accurate representations of religious figures, but were characterisations of the show's participants."
A BBC spokeswoman said the corporation was "pleased" Ofcom ruled in its favour.
"We believe that Ofcom and the GPCC's [Governors' Programme Complaints Committee] earlier adjudication recognise the importance of freedom of artistic expression," she said.