As Pablo Lucio Vasquez, the Texas Vampire, was executed for killing a 12-year-old boy and – according to his own account – drinking the child’s blood - he had a message for relatives of his victim:

“You got your justice right here."

It was, perhaps, a reminder that justice can be harsh, regardless of whether or not you think it fair.

Pablo Lucio Vasquez (Reuters)

And sometimes justice can be very harsh indeed, even for those who are not executed.

While some prison sentences provoke cries of horror that a criminal will be out of jail way too soon, in a few cases, it’s quite the opposite.

In pictures: Controversial executions Show all 5 1 /5 In pictures: Controversial executions In pictures: Controversial executions George Stinney Jr, 14 George Stinney Jr became the youngest person to be executed in the US in the 20th century when he was sent to the electric chair in 1944 during the trial that lasted less than three hours and reportedly bore no evidence and barely any witness testimonies. Reuters In pictures: Controversial executions Clayton Lockett, 38 Convicted of the murder and rape of 19-year-old Stephanie Neiman in 2000 and sentenced to death. Lockett died of a heart attack after a failed execution by lethal injection in April 2014 In pictures: Controversial executions Roy Blankenship, 55 Killed by lethal injection in 2011 after he murdered an elderly woman. Witnesses saw him grimace and jerk as he became the first person put to death in that state with pentobarbital. Medical experts said he “suffered greatly” In pictures: Controversial executions Michael Wilson, 38 Executed by lethal injection in January 2014. Wilson was convicted of murdering co-worker Richard Yost during a robbery at a convenience store in 1995. He is one of three people executed for the crime In pictures: Controversial executions Dennis McGuire, 53 Sentenced to death following the rape and murder of pregnant 22-year-old Joy Stewart in 1989. After spending 25 years on death row fighting the order to end his life, McGuire was executed by lethal injection in January 2014

Chamoy Thipyaso, Thailand - 141,078 years

The longest prison sentence handed down by a court is thought to be that received by Chamoy Thipyaso of Thailand, who in 1989 was given a jail term of 141,078 years.

The wife of a senior Thai air force officer, Thipyaso had been involved in a pyramid scheme that defrauded 16,231 people out of a total of about £2 million.

Given that some of her victims had allegedly been members of the Thai royal household, she probably wasn’t expecting leniency.

Thipyaso, however, was lucky in one respect because in 1989 Thai law decreed that regardless of the sentence given, the maximum time anyone could actually spend behind bars for fraud was 20 years.

Otman el Gnaoui, convicted over his role in the 2004 bombing attacks at Madrid's Railway Station (Getty Images)

Otman el-Gnaoui, Spain - 42,924 years

A similar technicality applied to terrorist Otman el-Gnaoui, who was given a 42,924-year prison sentence by a Spanish court for mass murder due to his part in the 2004 Madrid train bombings.

His accomplice Jamal Zougam got 42,922 years for involvement in the bombings that claimed 191 lives.

As in Thailand, however, Spanish law limits the time that can actually be spent in jail, so in practice the longest either man will remain in prison is 40 years.

Charles Scott Robinson, US - 30,000 years

When it comes to sentences where there is no hope of anything like a 40-year limit on time really served, the longest might be that of Oklahoma child rapist Charles Scott Robinson.

In 1994 a jury recommended 5,000 years’ jail for each of the six counts against him.

Then District Judge Dan Owens decided he was weary of criminals serving only a portion of their time. So to guarantee that Robinson wouldn’t be released early from any of the 5,000-year sentences, Judge Owens ordered them to be served consecutively rather than concurrently – landing the child rapist with a 30,000-year jail term.

“I think I can assure that you will spend the rest of your natural life in the confines of the Department of Corrections," the judge informed Robinson, who couldn’t get parole until he was at least 108.

Darron Bennalford Anderson, US - 11,250 years

Staying in the incarceration-happy state of Oklahoma, a contender for the most catastrophic appeal in judicial history might be that launched by rapist Darron Bennalford Anderson.

After being convicted of the robbery, kidnap and rape of an elderly woman in 1993, Anderson appealed, perhaps hoping to have a century or two knocked off his original 2,200-year sentence.

It went well for him at first. He won a new trial. That, however, also ended in conviction. And this time the jury decided his sentence should be 11,250 years – thus extending his jail term by 9,050 years.

Anderson is due for release on August 1 9746. Which gives him plenty of time to contemplate the fact his efforts have secured him a Guinness World Record entry for “the greatest amount of jail time given as a result of an appeal.”

When it came to appeals, Anderson’s accomplice Allan McLaurin was luckier. He got 500 years lopped off his sentence. Although since the original jail term was 21,250 years, he wasn’t that lucky.

Dudley Wayne Kyzer, US - 10,000 years

To find America’s longest sentence for a single count, you have to move to Alabama, where “Halloween murderer” Dudley Wayne Kyzer of Tuscaloosa got 10,000 years for killing his wife.

Desbribed as a “born killer” by one prosecutor, Kyzer was convicted of killing his estranged wife, Diane Kyzer, his mother-in-law, Eunice Barringer, and Rick Pyron, a college student, who by complete mischance was at the Barringer home on Halloween in 1976.

He was sentenced to death in 1977, but in 1980 the US Supreme Court overturned Alabama’s death penalty as unconstitutional, so Kyzer was retried. The result was that in 1981 he received two life sentences for the killings of Ms Barringer and Mr Pyron, plus the 10,000 years for murdering his wife.

Friends of Kyzer, now 74, say he has become a born-again Christian in prison and feels remorse. He was denied parole – for the 10th time – last month.

Andrew Aston (PA)

Andrew Aston, UK - 26 life sentences

The longest sentence ever received by a criminal in a UK court is the 26 concurrent life sentences imposed on Andrew Aston at Birmingham Crown Court in 2002.

During three months in early 2001, the cocaine addict attacked and stole from 26 elderly and disabled people in their own homes.

George Dale, 87, and Frank Hobley, 80, both died as a result of injuries inflicted by Aston. The killer was convicted of two murders and 24 charges of robbery.

It is understood that members of Aston’s defence team urged him to plead guilty in the hope of receiving a reduced sentence. Instead the killer insisted on having his day in court, thus forcing some of his victims to relive their ordeal in the witness box, and probably helping ensure he got a life sentence for every pensioner he attacked.

His 26 life sentences eclipsed even the 21 life sentences received by the Birmingham Six, who in one of the worst miscarriages of justice in British history, were wrongly convicted of a series of 1974 pub bombings attributed to the IRA.

The Birmingham Six spent 16 years languishing in jail before their innocence was recognised. Even their ordeals, though, might pale in comparison to that of Ricky Jackson, who spent 39 years behind bars for a murder he did not commit – thought to be America’s longest wrongful prison term.

In 1975, aged 19, Mr Jackson was convicted with two friends of murdering salesman Harry Franks outside a Cleveland corner store – on the evidence of a 13-year-old boy who claimed to have been a witness, but had in fact been on a school bus a block away at the time of the murder.

Mr Jackson was initially handed a death sentence, and was saved from execution only by appeals and mistakes in paperwork.

The boy witness recanted as an adult, but it wasn’t until he signed an affidavit saying he had lied and been coerced by police into testifying that Mr Jackson was cleared by a judge in 2014.

Last year he received more than $1 million (£680,000) in compensation from the state of Ohio for his wrongful imprisonment.

Albert Woodfox, US - 43 years in solitary confinement

In terms of suffering while inside, it might be hard to find worse than that of Albert Woodfox, who was released from a Louisiana jail in February after spending 43 years in solitary confinement – despite professing his innocence.

Mr Woodfox is thought to have endured the longest stretch in solitary of any US prisoner, spending 23 hours a day in a six-by-nine-foot cell for 43 years, and being allowed only one hour’s daily exercise in a fenced concrete yard where he was kept shackled and alone.

He was serving time for another offence when he and two others – who became known as the Angola Three - were convicted of the 1972 murder of a prison guard.

Mr Woodfox and his supporters claim that all three men were wrongly convicted in retaliation for leading hunger strikes against “inhumane prison conditions” and for being members of the jail’s Black Panthers chapter.

In 1992 Mr Woodfox’s conviction was quashed on the grounds that he had not had effective assistance of counsel, but he was convicted at a second trial in 1998. That conviction was itself overturned in 2013 because of discrimination in the selection of the grand jury foreman.

His release came after the state of Louisiana agreed to drop its threat to subject him to a third trial in return for him pleading no contest to lesser charges of manslaughter and aggravated burglary.

Mr Woodfox emphasised that his no contest plea was not an admission of guilt, issuing a statement explaining: “Although I was looking forward to proving my innocence at a new trial, concerns about my health and my age have caused me to resolve this case now and obtain my release.”

In 2014, he told a blogger what he was suffering in solitary: “I’m afraid I’m going to turn into a baby and curl up in a foetal position and lay there like that day after day for the rest of my life. I’m afraid I’m going to attack my own body, maybe cut off my balls and throw them through the bars the way I’ve seen others do when they couldn’t take any more.”

Paul Geidel Junior, US - 68 years and 245 days

As for the longest time anyone has spent in jail before being released to tell the tale instead of dying of old age behind bars, that dubious honour falls to Paul Geidel Junior.

In 1911 Geidel was a 17-year-old bellhop working in a New York hotel when he sneaked into the room of guest William H Jackson. The wealthy 73-year-old woke up and in the ensuing struggle, Geidel accidentally killed him by suffocating him with a rag filled with chloroform.

Geidel’s crime earned him only a few dollars. He was arrested two days later, before being convicted of second-degree murder and sent to prison in 1911 for 20 years to life.

A total of 68 years and 245 days later, Geidel, now aged 86, was released. By a margin of a few months, he had beaten the record Johnson VanDyke Grigsby, who had served 68 years and three months by the time he left Indiana State Prison in 1976.

Geidel, who had endured bouts of insanity inside, had been granted parole in 1974, but having been in prison all his adult life and fearing how he would cope on the outside, he chose to stay in jail for a further six years.