Western Australia's highest court has almost doubled the prison term of a man who left a truck driver with permanent brain damage after attacking him with a hammer at a service station in the state's Mid West.

Stephen Christopher Darroch, 44, was originally sentenced in July last year to six years in jail, after he pleaded guilty to attacking Ross Tapper in a toilet cubicle at the station in September 2016.

Darroch struck Mr Tapper several times to the head, leaving him with life-threatening injuries to his head and causing permanent brain damage.

Mr Tapper was taken to Royal Perth Hospital where he underwent emergency life-saving surgery, which involved removing part of his skull.

Darroch fled the scene after the attack.

Police later arrested him about 70 kilometres south of Meekatharra and took him to Mount Magnet police station, where he punched an officer in the face.

Darroch hit the truck driver with the hammer several times in the head. ( Flickr: hyper7pro )

The judge who sentenced Darroch last year said his victim's life had been totally ruined, with the attack leaving him needing ongoing 24-hour care and supervision.

But state prosecutors appealed against the six-year term he handed down, arguing it inadequately reflected the serious nature of the offending, including the effect on the victim and the need to properly provide for deterrence and community protection.

In submissions to the court, they argued the original sentence was "simply wholly inadequate".

Darroch to spend at least eight years in jail

In its judgement, the Court of Appeal agreed the sentence did not reflect the seriousness of the crime, and ruled Darroch should instead receive a 10-year jail term.

He will have to serve a minimum of eight years behind bars before he can be released.

Darroch had a history of physical and mental health issues prior to the attack and suffered from a schizoaffective disorder, with relatively manageable symptoms through the use of anti-psychotic medication.

However, he had a long history of not complying with his medication, coupled with entrenched illicit drug abuse.

Two days before the attack, Darroch had received a slow-release injection of antipsychotic medication, but the dose was two weeks overdue and was unlikely to have had any beneficial effect by the time he committed the crime.

He had been abusing methylamphetamine and alcohol in the days prior to the incident.