ISTANBUL — A court here on Friday charged Fazil Say, a classical and jazz pianist with an international career, with insulting Islamic values in Twitter messages, the latest in a series of legal actions against Turkish artists, writers and intellectuals for statements they have made about religion and Turkish national identity.

Mr. Say, 42, who is also a composer, is accused of “publicly insulting religious values that are adopted by a part of the nation,” the semiofficial Anatolian news agency said. A trial is scheduled to begin on Oct. 18, with Mr. Say facing up to 18 months in prison if convicted.

It is unusual for Twitter posts to be the subject of an indictment in Turkey. Some of the messages were written by Mr. Say, but one, which poked fun at an Islamic vision of the afterlife, was written by someone else and passed along by Mr. Say via his Twitter account. Likening heaven’s promise of rivers of wine to a tavern and of virgins to a brothel, it referred to a poem by the 11th-century Persian poet Omar Khayyam, Mr. Say said in a text message from Slovenia, where he had just arrived for a concert.

Another Twitter post, this one written by Mr. Say, joked about a muezzin’s rapid delivery of the call to prayer, asking if he wanted to get away quickly for a drink. The messages are no longer available online. The pianist, who has frequently criticized the pro-Islamic Justice and Development Party government over its cultural and social policies, publicly defines himself as an atheist — a controversial admission in Turkey, which is overwhelmingly Muslim.