An investigation is underway to determine how a prisoner who raped a nine-year-old boy on Queensland’s Sunshine Coast was able to contact his victim.

Queensland prison authorities are investigating how a pedophile was able to send a letter to his victim from behind bars.

Christopher John McCoy, 21, was able to post the letter to the nine-year-old boy despite being convicted of raping him and sentenced to jail, the Sunshine Coast Daily reports.

The boy’s mother, who can’t be named, said the letter was a “sob story” to her son about how tough prison was.

“The thing that revolted me the most was the bit at the end where he told my son he would always love him,” she told the newspaper.

A Corrective Services spokesman apologised to the boy’s family and said an investigation was underway.

“Additional vetting measures have been implemented to ensure there is no recurrence,” he said in a statement.