A performance by Elton John has sparked outrage among Morocco's anti-gay conservatives and tested the limits of the country's modernisation drive.
Islamists in the North African kingdom were furious at the gay pop star's visit, while the royal palace, government and his many fans backed his appearance on Wednesday night.
Authorities had beefed up security with thousands of police and plainclothes officers but no riots or violence was reported, said Rabat's governor, Hassan Amrani.
Mr Amrani said about 50,000 people attended the free concert in a wealthy neighbourhood of the capital.
Other entertainers performing at the May 21-29 festival include Sting, Mika and Carlos Santana and Arab music stars.
But in an apparent move to defuse possible tensions, Sir Elton was the only festival artist who was not scheduled to meet the local media.
The tension over the concert is part of a tussle between conservatives and modernisers in a nation that criminalises homosexuality but has long been famous for a swinging party scene.
Morocco has attracted gay celebrities such as designer Yves Saint Laurent and writer Paul Bowles, and recently saw the launch of its first gay magazine.
Across the Islamic world, strictly hidden, but sometimes tacitly tolerated traditions of homosexuality are surfacing fitfully - and Sir Elton's concert is the latest litmus test.
The public dispute between organisers for the Mawazine Festival that invited Sir Elton and the Justice and Development Party, or PJD, Morocco's largest authorised Islamist group, illustrates the growing rift between Western-leaning Moroccan authorities and the more conservative Muslim movements that are on the rise in the kingdom.