Nazril Irham, an Indonesian pop star known as Ariel, was jailed on Monday for three and a half years for making sex tapes with celebrity girlfriends that spread wildly on the internet.
The case, which led to a wide crackdown on Internet porn in the world's most populous Muslim nation, highlighted a divide between a youthful Indonesia, which opposes internet censorship, and conservative pressure groups.
Outside the court, clashes broke out between fans of Ariel and hundreds of protesters calling for a harsher punishment, according to news reports.
Irham, known to fans as Ariel, was jailed under a pornography law passed in 2008, and championed by conservative Islamic groups, that bans public displays of nudity and behavior that could incite lust.
"The defendant is legitimately and convincingly guilty of giving chances for others to spread, make and provide pornography," said judge Singgih Budi Prakoso in a west Java court where 1,000 police were posted to control the crowd.
"As a public figure, the defendant should be aware that fans might imitate his behaviour," Prakoso said, the BBC reported.
The sentence drew howls of outrage from singer Ariel's fans in the court and across the Malay-speaking world, while the "freeariel" hashtag shot to the top list of global trending topics on Twitter.
Ariel denied distributing the videos, saying they had been stolen, but the judge said Ariel had done nothing to prevent the wide distribution of the videos.
Irham was also fined 250 million rupiah ($27,692).
The court heard that Ariel had made three sex videos featuring him and, separately, two female celebrities.
The first six-minute clip showed Ariel in bed with his girlfriend Luna Maya, a top model, actress and, until the scandal, the face of Lux beauty soap. The second clip showed him with a former girlfriend, also a well-liked model and television presenter.
Police said earlier a friend of Irham's had taken the sex tape off his computer and posted it on the Internet.
Under the pornography law, anyone who produces, makes, copies, circulates, broadcasts, offers, trades, loans or provides pornography can be jailed for between six months and 12 years and can be fined up to six billion rupiah ($665,900).
Teenage female fans of Irham's band, Peterpan, wearing T-shirts with the word "freedom," jostled with Muslims wearing skullcaps and headscarves in the court.
The trial has become a target for protests by hardline Muslim groups who have adopted pornography as a banner issue, claiming it symbolises what they have called the nation's moral decline.
After the Irham case blew up, Communications and Information Minister Tifatul Sembiring, a member of the Islamic PKS party, called for tighter internet controls, including requiring providers to stop access to pornography or browsing services could be closed.
The BlackBerry telephone provider, Research In Motion (RIM), has also been asked by the government to prevent pornographic content from being made available through their devices if they wish to maintain distribution in Indonesia.
The law was seen by many as a step back in democratic and officially secular Indonesia, where foreign investors are hoping for more openness and pro-market reforms to increase its allure as an emerging market investment destination.