Two 11-year-old boys found guilty of attempting to rape an eight-year-old girl were spared custody today after a judge ruled they did not realise the severity of their crime. The pair were instead given a three-year supervision order that will see them rehabilitated in their communities under the watch of probation, police and social services.

The boys are among the youngest people on the sex offenders register after their conviction at the Old Bailey in May.

They were 10 last October when they tried to assault the girl on their housing estate in west London in an incident described by one of their barristers as "a game called show me yours and I will show you mine".

A jury acquitted them of two charges of rape but found them guilty of attempted sexual assault.

Today, Mr Justice Saunders ruled the boys should stay on the register for two and a half years, but said their mothers could sign it and notify the authorities of their children's whereabouts.

Both women were also given a one-year parenting order, which usually requires parents to attend counselling and guidance sessions.

Wearing a suit instead of a wig and gown, the judge told the boys: "I do not accept that what happened was a game but I do accept that you did not realise how serious what you were doing was."

But he said a custodial sentence would be "counterproductive" and not in the best interests of the boys.

The decision to try the children in an adult court was heavily criticised by children's campaigners.

The older boy's barrister described today how he had been affected by his experience in the criminal justice system. "He has probably suffered more than any adult that has gone through this process, simply because of his age," said Chetna Patel.

"For a 10-year-old to be taken to a police station for 24 hours is a terrifying experience. And no matter how much your lordship tried to make this an undaunting experience, it is still the central criminal court and it still daunted [him].

The boys, who had been told in advance that they would not be jailed, smiled shyly as they entered the courtroom at the start of today's brief hearing.

Unlike in a normal crown court case, they did not have to sit behind the glass of the dock. Instead they sat behind their barristers.

After sentencing, the older boy was led out of court holding his mother's hand, while the other was left to walk out on his own as his mother trailed behind.

During the trial, the jury was shown a recorded interview in which the girl played with a teddy bear while telling police officers how the boys had exposed themselves, pulled down her pants and raped her.

The girl's story changed when she was cross-examined via videolink. She said she had lied to her mother because she had been "naughty" and was worried she would not get any sweets.

But the judge refused to throw out the case, saying it was up to the jury to decide whether as a witness she could be trusted.

After the sentencing, Saunders said lessons needed to learned about "how best to receive the evidence of very young children" to ensure both a fair trial and also the welfare of the witness.

The judge is compiling a report about the case to submit to the lord chief justice, the most senior judge in England and Wales, who has the ear of cabinet ministers. "That is not to indicate that there is anything wrong, but we should do everything we can to improve how we deal with these things by looking at the lessons that we can learn," said Saunders.

His view was echoed at the court of appeal last month, where the boys lost their bid to overturn their convictions.

Lord Justice Hughes spoke of the "dismay" that three such young children should take part in a crown court trial, adding that there was concern about the effect of a "publicly staged trial in this arena on the ability of a little girl to move on with her life".

But yesterday the Ministry of Justice said: "The government has no plan to raise the age of criminal responsibility as we believe children aged 10 are able to weigh up right and wrong in the same way that older children or adults can."