The man accused of killing Daniel Morcombe was ambushed by police at the site where they believed he had dumped the Queensland schoolboy's body eight years earlier.
The trial of Brett Peter Cowan on Thursday heard how he was arrested in the Sunshine Coast hinterland in August 2011 following a lengthy police investigation that began when Daniel, then aged 13, disappeared in December 2003.
Detective Sergeant Graeme Farlow told jurors he, a number of detectives and police went to a clearing at the end of Kings Road in the Glass House Mountains on August 13 and hid.
"I secreted myself behind a pile of timber with Detective Senior Sergeant Edwards," he told the Supreme Court in Brisbane.
"I observed a Toyota HiLux to drive into this location. It contained the accused and two other gentlemen."
Det Sgt Farlow said two detectives approached the car and spoke to Cowan, now aged 44, while he and another officer spoke to one of the other men, who turned out to be an undercover policeman from Western Australia.
Cowan was arrested at the scene and taken to police headquarters in Brisbane, the court heard.
Crime scenes were established at the hinterland site and the painstaking search for Daniel's remains began on that same day.
Over the next month, 17 bones or bone fragments and a pair of Globe shoes were found scattered at the bottom of an embankment near the clearing where Cowan had been arrested, the court heard.
Police scientific officer Donna MacGregor said the bones were more than five years old and belonged to a person aged nine-and-a-half to 14.
The remnants of a pair of boys' underpants, a pair of shorts and a belt were found in nearby Coochin Creek, less than 20m downstream from a bridge where Cowan allegedly said he dumped them.
The court also heard there were no traces of DNA, blood or any evidence found in a white Mitsubishi Pajero four-wheel drive that belonged to Cowan.
The prosecution is arguing Cowan drove Daniel's body from a demountable house and dumped it at the bottom of the embankment.
Meanwhile forensic scientist Catherine McGovern, who gave evidence from New Zealand by video link, told the court a partial DNA profile taken from an upper arm bone found at the search site closely matched DNA from Daniel's toothbrush.
Most of the bones were found 10 to 15cm below the surface of the ground, indicating the body had been placed on the surface.
Daniel disappeared while waiting for a bus at Woombye on the Sunshine Coast hinterland.
Cowan has pleaded not guilty to murder, indecent treatment of a child and interfering with a corpse.
The trial continues.