A Lebanese indie band is to play at a music festival in their home country next month, but only after apologising for two songs deemed offensive to Christians, organisers said.

Mashrou’ Leila, whose singer is openly gay and whose outspoken Arabic lyrics tackle often taboo social issues, have created waves in the religiously conservative Middle East.

They have played frequently in Lebanon since forming in 2008 while studying at the American University of Beirut.

But they have sparked controversy in Egypt and were banned from performing in Jordan.

On Monday, Lebanese clerics called for the band to cancel their planned performance at the high-profile summer festival in the seaside resort of Byblos, charging that their songs were offensive to Christians.

Late Wednesday, the festival’s artistic director, Naji Baz, said a compromise had been reached after a meeting with the town’s Maronite bishop.

“We reached an arrangement whereby the concert will happen as planned, as long as the band holds a press conference in the coming days,” he said.

The band is to “apologise to all those who may have been offended” by two of their songs considered to be “insulting to sacred symbols in Christianity”, he said.

The two offending songs – titled “Idols” and “Djin” – will not feature in their set at the festival on August 9, he said.

The complaints seem to have been made after lead singer Hamed Sinno shared an article on Facebook containing an image in which the Virgin Mary’s face had been replaced by that of American pop diva Madonna.

The band took down posts “violating sacred symbols of Christianity” at the request of the General Security department, the prosecutors’ office said.

The band issued a statement on Monday saying they “respected all religions and their symbols”, and were saddened by “the distortion of the lyrics of some of our songs”.

After a Mashrou’ Leila concert in Egypt in 2017, at which members of the audience waved a rainbow flag, the authorities launched a crackdown on the country’s LGBT community.

Planned performances by the band in Jordan were cancelled in 2016 and 2017, amid protests by conservative lawmakers.

Religiously diverse Lebanon is one of the Middle East’s more liberal countries, but its myriad of recognised sects still wield major influence over social and cultural affairs