A young American man travelled to the UK in a "jealous rage" intending to kill a teenage woman who had ended an online relationship with him, a court has heard.

Shane Coffey, 20, hid in the garden of a home in Epsom before breaking in and repeatedly stabbing his 18-year-old victim.

Guildford Crown Court was told on Friday that the actions of Mohammad - who was also wounded as he fought Coffey with a metal bar - had undoubtedly "saved her life" on Good Friday this year.

Coffey, of Lincoln Street, Weymouth, Boston in Massachussets, was jailed for life with a minimum term of eight-and-a-half years, having previously admitted attempted murder, now 19, as well as wounding with intent to cause grievous bodily harm.

Gino Connor, prosecuting, told the court the computer-savvy defendant planned out his actions in detail and had every intention of killing his victim.

The pair, who had never seen each other in person, were in an online relationship after meeting through a gaming site when she was 13.

The court was told they did not speak for two years after Coffey hacked her laptop remotely to read her online conversations.

Shane Coffey
Shane Coffey smiling in his custody picture

She later bought an Apple computer to prevent against hacking, and they began speaking again in November 2013 when Coffey apologised for his actions.

They subsequently exchanged gifts over Christmas, but she then called an end to the relationship in February this year.

"The defendant carefully planned the trip to England to exact revenge for the way he perceived he had been treated," Mr Connor said.

The court heard Coffey had flown to the UK and checked into the Premier Inn hotel in Epsom.

The prosecutor said he was in possession of a knife which he "hid or placed in his suitcase together with tape, nylon cable ties and gloves".

The court was told Coffey used Google Maps to print out a route from his hotel to the home.

During the daytime on Thursday April 17 this year he walked to the house - the prosecution suggested this was a recce of the route and location, but the defence argued he was intending to commit the crime then but changed his mind.

It was said Coffey had managed to hack into her Apple computer and returned "with a sinister motive" that night after reading online conversations she had with other males.

The court heard he hid in the garden for an hour before breaking in shortly after 4am on Friday April 18.

She suffered arm and thorax injuries as Coffey launched into the knife attack while she was asleep in her bedroom.

Mohammad heard her cries and hit the intruder three or four times with a metal bar, before Coffey said "stop, enough, I'm done" - which the court was told were the first words he had said.

Mr Connor said: "There's no other way to describe Mohammad actions than brave and fearless. There's little doubt that his actions saved her life."

Mohammad was wounded in the head, lower leg and hand. Both victims were taken to St George's Hospital in Tooting with serious but non-life threatening injuries.

Coffey was arrested and sectioned under the Mental Health Act before later being arrested and charged following an assessment.

He had conducted Google searches for hand-to-hand combat with a hunting knife, life in UK prisons and the Epsom local policing team, it was revealed in court.

Shane Coffey
Another picture of Shane Coffey as a child

The court was told Coffey initially blamed his actions during police interview on voices in his head.

Richard McConaghy, defending, said: "Those issues he thought were in his head were not what provoked these actions, but it was his jealous rage."

Mr McConaghy said Coffey had a "very troubled background", telling the court he was "brought up in a home where his mother was a classic drug addict and his father was an alcoholic".

"He lived in a world where he lived his life online rather than forming meaningful relationships," the defence barrister added.

A psychiatrist who examined Coffey described him as a "very unusual young man".

In sentencing him, Judge Christopher Critchlow said: "You have demonstrated strong manipulative and predatory traits when you have felt you have been mistreated by a female.

"You told the probation officer you felt jealous and paranoid when she finished the contact with you.

"By way of revenge, you then meticulously planned to kill her.

"It is difficult to imagine a more nightmarish situation for a young female, asleep in her own bedroom and woken to find herself being attacked by a man intent on killing her."

The judge suggested Mohammad should be put forward for a bravery award for his actions, what he called a "rare example of such an award".

'Persisted in harassing'

Other charges of attempted murder, wounding with intent to cause grievous bodily harm and aggravated burglary will lay on file.

Following the sentencing, Surrey Police's Temporary Detective Chief Inspector Antony Archibald said: "This case was extremely complex and involved a set of unusual circumstances which could never have been foreseen by the victims.

"Coffey had previously been in contact with the two victims through online gaming.

"He persisted in harassing them even after they tried to break off communication and in April travelled to [the UK] from America without their knowledge or invitation.

"This was an extremely frightening incident, carried out by a troubled man who carefully planned the attack with disturbing precision.

"We have no doubt that Coffey intended to kill that night and he may have done had it not been for the brave and courageous actions of those who stopped him.

"While this kind of incident could not have been anticipated and is extremely rare, it is a clear reminder of the dangers that the internet may pose."