KSAR EL KEBIR, Morocco (Reuters) - When rumors of a "gay wedding" spread through the northern Moroccan town of Ksar el Kebir, the only evidence produced was a video on YouTube of a man dancing suggestively in women's clothes.
Three months later, four people are in prison accused of homosexual acts, Islamists are decrying a decline in public morals and liberals are warning that the north African kingdom risks sleep-walking into extremism.
A reputation as a tolerant, nascent democracy has earned Morocco privileged ties with the European Union and helped draw millions of tourists to its cities, mountains and beaches.
But rights campaigners say the events in Ksar el Kebir are the latest sign that personal freedoms are in danger as the secular government seeks to placate powerful Islamists.
"Morocco has become a society where debate is much freer than before but many people are not happy with that freedom," said Issandr el Amrani, north Africa specialist at International Crisis Group. "There is a real risk of people with conservative agendas influencing politics."
The Islamist Justice and Development Party (PJD) has become a major political force by drawing on popular anger at poverty and corruption and calling for more morality in public life.
Despite lingering suspicions that the PJD wants to turn Morocco into a purist Islamist state, the secular establishment sees the party as part of a moderate religious bulwark against increasingly active and well-organized radical Islamist groups.
But some say this attitude has resulted in more restrictions on personal freedoms to comply with Islamist beliefs.
Organizers of an open-air pop concert held last May to encourage young people to vote in legislative elections were surprised by what was written about their event in the conservative newspaper Attajdid.
"It said people had stripped naked, climbed on the minaret of a mosque and stopped Muslims praying -- it was simply untrue," said Reda Allali, singer in rock band Hoba Hoba Spirit.
"When someone holds a concert, these populists always trot out their favorite themes: Zionists, Satanists, drugs, homosexuality and George Bush," said Allali.
In universities, tensions have grown between left-wing students and Morocco's largest Islamist opposition movement Justice and Charity, which now dominates the main student union.
Justice and Charity, which is banned from mainstream politics because of its open hostility to the monarchy, has set up informal morality tribunals in some universities, said Driss Mansouri, philosophy professor at Sidi Mohamed Ben Abdellah University in Fez.
"If they decide a couple of unmarried students are in a close relationship, they punish them. Some students have even been beaten -- it's a rural mentality," said Mansouri.
Human Rights Watch has called for the release of the four men jailed in Ksar el Kebir. The men say the "gay wedding" only ever existed in the minds of suspicious neighbors.
The rumors began after wine merchant and former circus artist Fouad Frettet held a party for friends and neighbors.
Local people said Moroccan Sufi mysticism featured prominently. A black bull was paraded through the streets and sacrificed to appease a demon thought to be lurking under a local bath-house.
The bull was cooked and eaten while Gnawa musicians -- who are known for their poverty and their pleasure-seeking lifestyle -- provided the entertainment.
When word of the party spread, partly through the Internet video, thousands of angry men marched on Ksar's central mosque.
"The police feared the crowd. If they'd intervened it would have been terrible," said rights campaigner Abdellah el Baad.
The mob attacked the car of a jeweler accused of funding the party, ransacked Frettet's wine store and pelted his house with stones and bottles as his family hid within, Baad said.
Frettet emerged from hiding a few days later and appealed to the police for protection. He was arrested and tried along with two jobless men, two laborers, a barber and a waiter.
He said he had been a homosexual in his youth but pointed out that he was now married with children. He was jailed for 10 months for homosexual acts and the illegal sale of alcohol. Five others were jailed for between four and six months, sentences that were shortened on appeal.
Frettet's unemployed brother Redouane told Reuters that no wedding had taken place.
"Allowing this mob to attack our family was an act of terrorism," he said, dragging nervously on a cigarette outside the family home, its walls still bearing the marks of the attack. "Fouad was injured and our mother's house was destroyed -- now he's in prison and he's in a bad state."
Political leaders denied they exploited the situation to burnish their conservative credentials.
"The crowd reacted on its own. It didn't need any encouragement," said Ksar el Kebir council leader Said Khairoun from the Islamist PJD party.
Commentators are divided over whether what happened in Ksar el Kebir was proof of the rising power of Islamists. For analyst Mohamed Darif, the issue was homosexuality, which has always been tolerated in Moroccan society -- if no one finds out about it.
"We are dealing with a conservative society," Darif said. "(Governing party) Istiqlal is not a religious party but you won't find any Istiqlal leader who'll defend homosexuality."
Others interpreted the incident more broadly, seeing it as one more example of a society becoming more restrictive.
"Must we wait until violence breaks out in full daylight to sound the alarm?" asked current affairs magazine TelQuel in January.
Additional reporting by Zakia Abdennebi; Writing by Tom Pfeiffer; Editing by Clar Ni Chonghaile