A Sydney man who groomed a 14-year-old Canberra boy for sex will walk free from jail, with the courts fearing a prison term for the HIV-positive offender would be a ''death sentence''.

Brendan Russell Sinclair, 43, pleaded guilty to sending dozens of sexually explicit text messages to the boy between April and July 2007, after they met on a mobile social networking site.

Sinclair sent the Canberra teenager porn videos and nude images, before booking the victim a ticket to see him and his then-boyfriend for sex. The offender even helped the 14-year-old devise a story to help him explain his absence to his family.

But the offender was detected by the boy's mother on a social networking site, where Sinclair was posing as a 28-year-old named Ben.

The mother went to police, who posed as the victim and began corresponding with Sinclair.

Australian Federal Police raided Sinclair's Sydney address the day after he booked the victim a ticket to Sydney. He was arrested and extradited to the ACT in 2007, pleading guilty to using a carriage service to communicate with a person under 16 for the purpose of making it easier to engage in sexual activity.

He attempted to change that plea this year, saying his solicitor had given him the impression he must plead guilty or risk dying in jail.

He also tried to blame his then-boyfriend for the text messages, and said he had consumed drugs and alcohol and couldn't remember parts of the offence.

Sinclair was raped when he was seven years old, and began working as a child prostitute when he was 12. He was raped again when he was 14 or 15, and again aged 17 or 18, when he was infected with HIV. He also had a history of drug use, starting with cannabis at the age of 11.

He began using amphetamine and cocaine at the age of 16, and then LSD and heroin when he was 17. Psychological assessments found Sinclair to be depressed and suicidal.

His lawyers had previously argued his health problems, including his HIV, would make it hard for him to serve a prison term.

Chief Justice Terence Higgins yesterday sentenced Sinclair to two years and nine months' jail, suspended to a three-year good-behaviour bond.

Chief Justice Higgins noted he faced a ''difficult dilemma'' in sentencing the terminally ill man and described the case as ''almost unique''.

''I am satisfied that, if I required the offender to serve another six months of such a sentence, then, despite the best endeavours of prison authorities, absent his current support network, he would not survive the sentence,'' he said.

''It would be a death sentence.''

Chief Justice Higgins urged Sinclair to comply with support programs, particularly for sex offending.

''In some cases, though terminally ill, a prisoner's fate may not be made worse in terms of length of survival. This is not such a case,'' Chief Justice Higgins said.

Sinclair will walk free after serving 58 days in custody in 2007.