Sir Elton John has performed at a music festival in Morocco in the face of calls for his appearance to be banned.
"I thank Morocco, the royal palace and the festival for inviting me," the British star said on Wednesday. "I am proud to be singing in Morocco."
Islamist groups had tried to prevent John's appearance, claiming the openly gay singer would offend public morals.
But organisers of the Mawazine festival in Rabat defended his invitation in the interests of "cultural tolerance".
Aziz Daki, the festival's artistic director, claimed more than 40,000 people had attended the free concert.
According to reports, though, others estimated the crowd to be closer to 15,000.
Members of Morocco's Islamist Justice and Development Party had tried to have the event called off on the grounds that it would pose "a risk of encouraging homosexuality".
But Mr Daki said to do so would "undermine the respect of privacy" and "breach certain values that the international Mawazine festival is based on".
The festival - which is under the patronage of Morocco's King Mohammed VI - has featured artists from around the world, among them Julio Iglesias, BB King and Carlos Santana.
Security was heightened at Wednesday's event, but in the end no disruption was reported.
The 63-year-old singer made headlines earlier this year when he claimed Jesus was a "super-intelligent gay man" in an interview with a US magazine.
Tentative plans for Sir Elton to perform in Egypt were reportedly shelved earlier this month.