A court in Istanbul has acquitted the best-selling Turkish novelist, Elif Shafak, who had been accused of insulting Turkish national identity.
Elif Shafak hoped her novel would encourage empathy
Ms Shafak, 35, had faced charges for comments made by her characters on the mass killings of Armenians in the final years of the Ottoman Empire in 1915.
Turkey rejects Armenia's claim that the killings constituted "genocide".
The EU welcomed the court ruling, but urged Turkey to scrap a law that makes it a crime to insult "Turkishness".
The trial was seen by the EU as a test of freedom of expression in Turkey, which began membership talks with the 25-member bloc last October.
Turkish Prime Minister Recep Tayyip Erdogan also welcomed the verdict and signalled that the government would consider amending Article 301 of Turkey's penal code. It envisages up to three years in jail for "denigrating Turkish national identity".
"The ruling party and the opposition can sit down together again to discuss this issue as laws are not eternal," Anatolia news agency quoted Mr Erdogan as saying.
The proceedings lasted just 40 minutes and ended in utter chaos, the BBC's Sarah Rainsford reports.
The judges said they based their decision on lack of evidence to prove that Ms Shafak "denigrated Turkish national identity" in her novel, The Bastard Of Istanbul.
Ms Shafak - who recently gave birth to her first child - was not present at the hearing.
Ms Shafak said by telephone that she was extremely relieved her trial was over.
But she expressed concerns that there would be other similar cases in the future as long as Article 301 "is out there".
The nationalist lawyers who brought the case walked out in anger shortly after the trial opened.
They claimed the court and judges had been unduly influenced by the EU.
Riot police moved in to stop scuffles between nationalists and leftists outside the courthouse.
'Autonomy of art'
One of the lawyers who filed the complaint against Ms Shafak had claimed that her novel was Armenian propaganda, dripping with hatred for the Turks.
One of the novel's characters speaks of "Turkish butchers" and a "genocide", while others talk about being "slaughtered like sheep".
Ms Shafak was the latest in a long line of writers to face similar charges in Turkey. But this was the first time Article 301 had been used against a work of fiction.
"If Article 301 will be interpreted in this way nobody can write novels in Turkey anymore, no-one can make movies any more," Ms Shafak told the BBC before the trial.
"The words of a character could be used as evidence against the author or the film director. I think it is extremely important to defend the autonomy of art, and of literature," she said.