After giving evidence at an inquest into the disappearance of Daniel Morcombe, Brett Peter Cowan boarded a domestic flight back to Perth.
It was early 2011 and the Sunshine Coast teen had been missing since December 7, 2003. Mr Cowan did not know he had been a suspect since a fortnight after the Sunshine Coast boy disappeared.
But he also did not know that the passenger seated next to him on the flight, known as Joe, was actually a police officer.
Queensland Crown prosecutor Michael Byrne, QC, on Tuesday outlined how an elaborate undercover police operation began, as he opened the case against Mr Cowan in Brisbane's Supreme Court.
Within weeks, Joe introduced Mr Cowan to some friends of his, including a man known as Fitzy - also an undercover police officer.
The covert officers allegedly convinced Mr Cowan they were part of a wide-reaching criminal gang, with friends in high places, who could ''fix'' anything.
''Part of what he was consistently told over a period of months is that there were three main mantras, or three main rules that members of this gang had to live by: loyalty, respect, honesty,'' Mr Byrne said. ''This was a ruse. It was part of the undercover operation.''
Mr Cowan was slowly included in the gang's criminal activities and was eventually allowed to observe some.
''He was then allowed to do some tasks for the gang,'' Mr Byrne said. ''He started with the minor and it increased in significance.''
He took part in a total of 24 scenarios, the court heard.
On August 9, 2011, Fitzy took Mr Cowan to a Perth hotel room to meet the gang's boss, Arnold - also an undercover police officer.
Arnold told Mr Cowan he expected loyalty, respect and honesty, Mr Byrne said. In return, he could make Mr Cowan's problems go away.
It was then that Mr Cowan allegedly confessed to Daniel Morcombe's murder, saying he had spotted him waiting at the bus stop and offered to give him a lift to the nearby shopping centre.
Instead of taking him to Maroochydore, Mr Cowan allegedly drove Daniel to an abandoned house on a Beerwah macadamia farm.
Mr Byrne read the recorded confession. ''I never got to molest him or anything like that. He panicked and I panicked and grabbed him around the throat and, before I knew it, he was dead,'' Mr Cowan allegedly said.
Arnold told Mr Cowan he would need to see the alleged murder site to ensure no incriminating evidence was left behind.
Mr Cowan boarded a flight to Brisbane the following day, where he met another of the gang's supposed members and drove with him to the site where he claimed to have dumped Daniel's body.
There, in the bush, the undercover operation came to an end.
The trial continues.