ANKARA, Turkey, Jan. 23 -- A Turkish court on Monday dropped charges against the country's best-known novelist for insulting "Turkishness," ending a high-profile trial that the European Union condemned as a serious infringement on free speech.

Orhan Pamuk went on trial for telling a Swiss newspaper in February that Turkey is unwilling to deal with two of the most painful episodes in its recent history: the massacre of Armenians during World War I, which Turkey says was not a planned genocide, and recent guerrilla fighting in Turkey's Kurdish southeast.

The controversy came at a particularly sensitive time for the overwhelmingly Muslim country. Turkey recently began membership talks with the European Union, which requires members to adhere to strict standards of free speech. Prime Minister Recep Tayyip Erdogan's government has passed reforms of Turkey's legal code with the aim of joining the E.U., but nationalist prosecutors and judges still often interpret laws in a restrictive manner.

"This case should not have been opened in the first place," said Haluk Inanici, the author's attorney.

Olli Rehn, the E.U. commissioner in charge of expansion, said the decision to drop the case against Pamuk was "good news for freedom of expression in Turkey," but that Turkey "needs to fill properly the loopholes" in its penal code and that other writers face similar charges.

Nationalist lawyer Kemal Kerincsiz, who pushed for Pamuk's trial, said he would appeal the court's decision. "It is a scandal," Kerincsiz said by telephone. "Orhan Pamuk must be punished for insulting Turkey and Turkishness. It is a grave crime."

The trial began on Dec. 16, but a judge sent the case back to the Justice Ministry, demanding that the government first approve the prosecution. Justice Minister Cemil Cicek responded last week by saying the ministry had no say over the case and left the critical decision to the local court.

The court on Monday interpreted that response as a refusal to give permission to try the case and dropped the charges, said Pamuk's attorney, Inanici.