Graham Dwyer committed "very nearly the perfect murder" when he killed Elaine O'Hara, the Central Criminal Court has been told.

Prosecuting lawyers told the jury that Mr Dwyer killed the childcare worker to satisfy his deep seated desire to get sexual gratification by stabbing a woman.

Mr Dwyer, 42, and from Kerrymount Close in Foxrock in Dublin 18, has pleaded not guilty to the murder.

Prosecuting counsel Sean Guerin outlined the circumstances in which items were found in Vartry Reservoir in Co Wicklow in September 2013.

In what was described as "a remarkable coincidence", a set of keys with a Dunnes Stores loyalty fob belonging to Ms O'Hara were found in the reservoir shortly after her remains were found in the Dublin mountains by a woman walking dogs.

The water in the reservoir was particularly low, and gardaí also found two mobile phones which the prosecution says were used by Ms O'Hara and Mr Dwyer in the days leading up to 22 August 2012, the day she was last seen.

The court was told Ms O'Hara had had psychiatric difficulties since she was a teenager and had been in hospital for five or six weeks before she disappeared.

She had visited her father on 22 August and they had visited her mother's grave before she went home.

The prosecution says she was last seen by a jogger near Shanganagh Cemetery asking directions to a bridge over the railway tracks.

She was 36 and had worked as a childcare worker and in a newsagents in Blackrock, Co Dublin.

Mr Dwyer was 39 in 2012. He was a highly successful architect and was married with two children.

The court was told there would be more than 400 exhibits in this case.

But the prosecution pointed to eight in particular, including a mattress taken from Ms O'Hara's apartment in Stepaside.

Warning: This report contains graphic details

Mr Guerin said DNA extracted from this mattress matched Mr Dwyer's DNA profile.

Mr Guerin said data extracted from Ms O'Hara's phone and an 083 phone the prosecution claims was used by Mr Dwyer showed that there was an unusual sexual relationship between them.

A central part of this relationship, the jury was told, was that acts of stabbing were committed on Ms O'Hara by Mr Dwyer.

The court was told the prosecution case was that the texts reflected a deep seated, passionately held, irrepressible desire on the part of Mr Dwyer to get sexual gratification by stabbing a woman.

Mr Guerin said this was a manipulative and abusive relationship designed to satisfy this desire.

Mr Guerin read some of the texts sent by the 083 number, which the prosecution claims was used by Mr Dwyer.

In one, he tells Ms O'Hara: "I am a sadist. I enjoy others' pain. You should help me inflict pain on you and help me with my fantasies."

He discussed how if she was suicidal, she would allow him to stab her to death.

Mr Guerin said he was manipulative and was trying to groom Ms O'Hara and to normalise the idea that stabbing was normal.

Another text from the 083 number said: "My urge to rape, stab and kill is huge. You have to help me control it or satisfy it."

Mr Guerin said texts sent from the 083 number related to events which tallied with events in Mr Dwyer's life, including the birth of his second child in 2011.

Mr Guerin read texts exchanged between the two phones found in the reservoir in the days leading up to 22 August 2012.

In one, Ms O'Hara, who had just come out of hospital, asked the other person not to mention killing for a while, while she settled back into life.

A text from the other phone said that night's punishment would be like him pretending to do something for real.

The prosecution says the texts between the two phones prove that Mr Dwyer arranged to meet Ms O'Hara at Shanganagh Cemetery to take her up the Dublin Mountains for the purpose of killing her to satisfy his desire.

Mr Guerin said when you look at all the elements in the case and put them together, the prosecution's case was that this was "very nearly the perfect murder".

Ms O'Hara was "almost the perfect victim".

She had been suffering from a psychiatric illness and there would have been every reason to think it was suicide.

He said it was highly unlikely the items discovered in the reservoir would ever have been found but for the dry summer and the fact that the water level had dropped.