By Adam Easton
BBC News, Warsaw
It was a gruesome murder that baffled the police for years.
Dariusz J's mutilated body was fished out of the Odra river in 2000
In November 2000, the bound and tortured body of businessman Dariusz J washed up on the banks of the River Odra near the Polish city of Wroclaw.
For years they had no motive or suspect. Then one day they were tipped off to read a novel which described an uncannily similar murder to the one they were investigating.
The book, published in 2003, is called "Amok" - and its 33-year-old author, Krystian B, is now on trial accused of murdering Dariusz J.
Prosecutors allege Krystian B murdered Dariusz J, a well-liked man who ran a small advertising company, because he suspected him of having an affair with his estranged wife.
They accuse Krystian B of kidnapping and locking up the victim, before torturing and starving him for three days. It is alleged he then tied the victim's hands behind his back so he was unable to swim and dumped him into the River Odra to drown.
The prosecution has asked for Krystian B to be given a 25-year prison sentence. A verdict is expected on Monday.
Krystian B denies murder, saying he wrote that section of the novel based on stories of the killing that appeared in the media.
The prosecution admit there is no direct proof the author, a philosophy graduate and keen photographer and scuba diver, committed the crime.
"There is no direct evidence of his guilt but there is a lot of circumstantial evidence," prosecutor Bogumila Fiuto told the court as he summed up his case.
Among the evidence are telephone records which show Krystian B phoned the victim just before he was kidnapped. The prosecution says he also sold the victim's mobile phone on an auction website four days after the murder.
During the trial witnesses described how Krystian B was jealous of his wife, whom he was separated from.
In a reference to his novel, experts told the court there were similarities in the characters of the author and the book's protagonist, Chris.
A re-enactment of the murder was broadcast on the Polish TV crime show, "997". Someone viewed the programme's website from foreign locations Krystian B was known to have visited.
The author is said to have made diving trips to South Korea and Indonesia at the time. It is also reported he took photographs of the tsunami relief action in Aceh.
Prosecutors allege Krystian B even admitted the murder during interrogation but subsequently retracted his confession.
"The fact that he admitted this is not conclusive evidence that he committed the crime," his defence lawyer, Karol Weglinski said.
He added it had not been proved beyond doubt the mobile phone had belonged to the victim. He did not deny Krystian B called the murdered man on the day of his disappearance.
"Even if you assume my client called Dariusz J you cannot kill a person armed only with a telephone," Mr Weglinski said.
During his testimony the author expressed his condolences to the victim's family and his regret that the police had not been able to catch the real killer.
"I've been waiting for this moment for 19 months since my arrest. I'm not responsible for killing Dariusz J," he said.