The man accused of murdering schoolboy Rikki Neave told a court he wanted to be caught when committing a series of crimes during his youth.
James Watson denies killing the six-year-old back in 1994, when he would have been just 13.
But he told jurors he had convictions for a string of crimes which began in his teens and ranged from stealing an unmarked police car to a sexual assault on a man.
Watson said, with one exception, he had always previously admitted the offences.
He said: "I wanted them to know it was me. Some of the crime I have done was to get in trouble. I have never lied to the police."
In August 2005, Watson stole uniform items, equipment and car keys from a police station and left in an unmarked car.
Asked to explain it, he said that "a lot" of his crimes had been to get arrested when his life was not going well.
"I went to a police station - that is the only place I have been where people ask: 'Are you OK? Are you alright?"'
Rikki Neave disappeared on his way to school in Peterborough in November 1994 and his body was found naked and posed in a star shape in woodland close to his home on the Welland estate the next day.
The defendant was charged with the schoolboy's murder after his DNA was found on Rikki's discarded clothes more than 20 years later as part of a cold case investigation.
Jurors heard Watson was on police bail over the murder in 2016 and living in a hostel as he awaited a charge decision.
But in June 2016, he travelled by ferry from Dover to the continent, ending up in Portugal in August of that year, before returning to the UK.
Watson said: "I left the country because of the stress I was under.
"I did not know my immediate future, I had been in a hostel for months and months. I wanted some control back.
"My intention was always to come back and answer to my police bail."
Earlier in the trial, Watson claimed he had picked up Rikki during a brief encounter in the street with the boy on the day of his disappearance.
On Tuesday, his lawyer Jennifer Dempster QC asked him: "Have you ever had sexual interest in children?"
Watson said: "No, never."
Ms Dempster went on: "Did you have anything to do with the murder of Rikki Neave?"
Watson told jurors: "I wish I could look every one of you 12 times in the eyes. But no, I did not kill Rikki Neave, I did not have anything to do with his disappearance."
Watson was living at a children's home at the time of Rikki's death and was regarded by social services as a "vulnerable" child.
He could not stay at home after his father, who had previously been a Cambridgeshire Police officer, was arrested and jailed.
While at a children's home in January 1995, Watson stole track signal detonators that gave off a loud noise, and laid them on a railway line.
Watson said: "It was fun. It reads worse than I remember it."
His "warped view" of police was formed from his experience of his father and being taken into care, jurors heard.
"It was the police that took me away so I was very mixed in my emotions in loving the police, but also hating them," Watson said.
The defendant was asked about a 2018 conviction for sexual assault on a man who had stayed over.
He said: "He was effectively sleeping beside me. During the night I reached out my hand, it landed on his stomach and briefly - incredibly briefly - my hand touched his penis. I withdrew it straightaway.
"The next morning I was disgusted with myself."
Watson, of no fixed address, denies murder and the trial continues.