A local court in Australia has sentenced a truck driver to a four-year prison term for stalking, robbing and attempting to rape a Chinese tourist.

Perth District Court announced the decision on Friday placing 49-year-old Peter Plumley behind bars for the crimes he committed in February 2015.

According to WA Today, the accused followed his 32-year-old victim into a public toilet and tried to rape her after watching her take a swim in a river at Balbuk Way, near Perth’s CBD.

Plumley reportedly demanded the woman to engage in a sex act with him, prosecuting lawyer Peter Phillips told the court.

The unnamed woman, who was wearing her swimsuit during the assault, refused and struggled to get away, screaming and running away from the man.

“The victim shouted at him, ‘What are you doing?’… rushed into one of the cubicles and closed the door and pushed against it to prevent the offender from entering,” Phillips said.

When she hid inside a cubicle, the stocky man forced the door open and tried to force the woman to give him oral sex.

“The offender pushed hard against the door which opened inward pinning the victim behind the door, moved into the cubicle and closed the door.”

The woman, who was then forced onto her knees and screaming, continued to struggle to avoid Plumley’s penis, which he had been trying to force into her mouth.

After a continuous struggle by the defiant woman, Plumley was forced to give up and flee the scene after the failed rape attempt. As he escaped, he stole the victim’s wallet.

Using the stolen wallet, which Plumley had thrown away after fleeing the scene, authorities were able to track him down 15 months later by using a DNA analysis.

“What happened here is very clear based on the facts before the court, which is the offender saw a woman who he may have thought was dressed revealing because she was swimming on a hot day in February,” Phillips was quoted as saying. “And he felt that he was entitled to follow her into a toilet cubicle and try to rape her.”

Phillips called the sexual assault as a “chilling and violent offense” against a tourist who was far away from her home, adding that the incident had left the victim “seriously traumatized.”

Stating that the offense was “every female’s worst nightmare”, presiding Judge Michael Bowden sentenced the middle-aged pervert four years and three months in prison, and he will be eligible for parole after two years and three months.

“As a result of the attack the victim naturally feels anxious and scared with strangers,” Bowden said.

“She became afraid to go out and travel alone, has nightmares, flashbacks about the experience and has suffered a reaction culturally to people or being a fear of people knowing about this offense.”