A teenager who tried to rape his sister after she had already been sexually abused by their father has avoided being locked up.

Judge Linda Sutcliffe told the 17-year-old, who cannot be identified for legal reasons, that she was taking a wholly exceptional course in his case because she wanted work to be done before his attitudes became "completely entrenched and embedded".

The boy, who was 16 at the time he attacked his teenage sister last July, will now be subject to a three-year supervision order and a six-month curfew between the hours of 9pm and 7am.

He had pleaded guilty to charges of attempted rape and sexual assault and Judge Sutcliffe told him that normally such a case would attract a custodial sentence of two to three years.

"As I have said, it is an exceptional course and it is a direct alternative to the sentence of custody that I would, in the normal course of events, have imposed," she said.

Bradford Crown Court heard yesterday that the girl, who also cannot be identified, had previously been subjected to sexual abuse by their father and Judge Sutcliffe said she must have been terrified by the latest attack on her.

"Had it not been for the fact that your mother came in when she did the likelihood is that you would have raped her," she noted.

"This case illustrates only too clearly the way in which, in families where there has been sexual abuse, the attitudes that are involved in sexual abuse are handed down from generation to generation.

"You are at a very impressionable age ... it seems to me if any work is going to be done with you, and it is going to be effective, it needs to be done before you attitudes become entrenched and embedded."

The teenage boy will now be subject to a sexual offences prevention order which includes a ban on seeking work which might involve unsupervised contact with children.

He will also have to register as a sex offender with the police for the next two-and-a-half years.