Russell Bishop, 52, is on trial for the second time accused of killing Nicola Fellows and Karen Hadaway following new forensic evidence.
The girls were sexually assaulted and strangled in a den in Wild Park, Brighton, in October 1986.
Bishop, a former roofer, was cleared of their murders in 1987.
But the Old Bailey heard how within three years he was convicted of abducting, sexually assaulting and trying to kill a seven-year-old at Devils Dyke on the South Downs.
On Monday Bishop told the jury he was “deeply ashamed” of what he had done in 1990 despite unsuccessfully attempting to appeal against his conviction.
He insisted he was not a paedophile but was just “bloody angry” at a hate campaign against him and thought “I might as well do it”.
When prosecutor Brian Altman QC asked him: “This was all about revenge?”
He replied “partly” before denying the offence was about sexual gratification or enjoying control over children.
Bishop said he assaulted the girl to “belittle and shame her because I was bloody angry at everyone – at her and everyone who had done that to me”.
He said it “could have been anyone” when the prosecution asked him why he attacked another young child.
“Through the psychological trauma of the hate campaign and what everyone else was saying it came out in that behaviour,” Bishop continued.
Mr Altman dismissed Bishop’s account as “rubbish” and “all lies”.
“You attacked that young girl because you had a sexual interest in children,” he said.
“It had nothing to do with three years of hate but everything to do with Russell Bishop and your character, didn’t it?
“There are very good reasons for what I also suggest are obvious and striking similarities between the two offences because the killer of those two girls in October 1986 was the same person who attacked (the seven-year-old) in 1990.
“And that man is you.”
Bishop became agitated when being questioned about his “sexual interest” in children.
He said: “Your honour. Is this legal? Is this correct?”
Mr Justice Sweeney told Bishop that it was.
More from UK
Matthew Hedges released after being pardoned by UAE
No action on climate change could mean even more extreme weather for the UK
UK weather forecast: ‘Major change’ in weather this week as Storm Diana approaches
Ex-Chelsea star Gianluca Vialli reveals year-long battle with cancer
Carney and Hammond to give evidence on impact of PM’s Brexit deal
Fiona Onasanya: Labour MP faces retrial over speeding allegations as jury dismissed
Bishop denies murdering Nicola and Karen.
The trial continues.