When he goes on trial for blasphemy in Lebanon this week, Marcel Khalife, one of the Arab world's best-loved singer-songwriters, is prepared to give the court an earful--whether or not he is sentenced to prison.

"I'm going to ask them: 'What am I doing here?' " said Khalife, who stands accused of offending Islam by singing a brief verse from the Koran. "I'm culturally ashamed. I think it's an ethical scandal that I'm here. Are we moving forward and building a happy future, or are we stuck in the past?"

Soft-spoken, impish, a veteran of concert halls and recording studios in the United States, Europe, the Middle East and North Africa, Khalife, 48, seems an unlikely blasphemer.

Politically, he is prone to a gauzy, love-thy-neighbor brand of liberalism. Religiously, although raised in a Christian family, he considers himself devoutly secular. He lived in Muslim West Beirut through much of Lebanon's long civil war. His CDs, on sale throughout the world, are hugely popular, and 90 percent of the buyers are Muslims, he says.

Khalife is a cultural icon in Lebanon, which prides itself on an openness and avant-garde spirit that sets it apart from most Arab countries. Despite the devastation of a 15-year civil war that ended in 1990, Beirutis think of their city as the cultural capital of the Arab world, and point to outspoken intellectuals and slightly decadent nightlife as proof.

None of that carried much weight with Lebanon's Sunni Muslim hierarchy, or with Beirut's new chief magistrate, Abdel Rahman Shehab. A day after taking office last month, Shehab, a Sunni Muslim, indicted Khalife for committing a crime against the country's dominant religion, Islam.

If found guilty, Khalife faces a prison term of six months to three years. The trial is scheduled to begin Wednesday.

Khalife's offense was to set to music a poem, "Oh, Father, it is I, Youssef," which contains at its end a verse from the Koran. The poem, by the renowned Palestinian writer Mahmoud Darwish, is a bitter lament that gives voice to the Koranic prophet Youssef (the Old Testament figure Joseph), whose brothers hated him and plotted to kill him. In the plaintive last stanza, Youssef asks if he wronged his brothers by telling them of his dream:

"I dreamt of 11 planets

And of the sun and the moon

All kneeling before me."

That stanza raised the ire of the Dar al-Fatwa, the senior Sunni Muslim religious authority in Lebanon. Quoting from the Koran is fine, the clerics said, but setting its verses to music and accompanying it with instruments is off-limits.

"When you include a musical instrument to accompany the Koran, you go beyond the respect due the word of God on Earth," said Mohammed Kabaneh, the grand mufti. "There are rules that must be respected. This issue has nothing to do with freedom. An artist can use the words written by people as he wishes, but he doesn't have the right to use the word of God."

The prosecution of Khalife is actually an encore performance. His song, first released in 1995, attracted attention almost immediately. But an indictment against him two years ago was dropped, reportedly at the prompting of the prime minister at the time, Rafiq Hariri.

Following the recent indictment, sales of the CD containing the offending song, "Arabic Coffeepot," have spiked. Several thousand of Khalife's fans and allies signed petitions on his behalf, and demonstrated their support for the singer at a pretrial hearing in early November. Darwish, the Palestinian writer whose poem Khalife adapted to music, appeared in Lebanon to perform with Khalife and embrace him. Abroad, Human Rights Watch, Amnesty International and other groups have expressed their concern publicly.

Rattled by all the clamor, Kabaneh, the Sunni mufti, barely consents now to discuss the case. When a visitor pressed him the other day on whether he objects only to Khalife's song or to popular music in general, he threatened to cut the conversation short.

"You don't seem to be aware of the high responsibilities of the mufti of the republic," he said. "We consider the matter closed."

Lebanon's cultural elite is not so willing to let it drop. Intellectuals in Beirut said the Khalife case fits an ominous pattern of recent attacks on artistic expression. They said they fear that Lebanon's status as one of the more tolerant societies in the Arab world could suffer if the balance tips toward Islamic fundamentalists.

A few weeks ago, Lebanese authorities censored a performance of modern ballet, singling out a scene in which women danced around men at prayer as "indecent" and offensive to Islam. The head of the ballet troupe, Maurice Bejart, himself a convert to Islam, dropped a whole section of his ballet rather than excise the scene. A recent sculpture exhibit generated a similar furor.

"Until now, Lebanon has had the most open freedom of expression in the Arab world," said Tewfiq Mishlawi, a Lebanese journalist and political analyst. "Here there is a different balance of forces [than in most Arab countries]. The liberals are much stronger. But there are worrying signs."