A transgender woman accused of raping a teenage girl when she was a man has been previously convicted of possessing indecent images of children, a court has heard.

Davina Ayrton, who has a son, was 23 at the time of the alleged attack on the 15-year-old girl in the autumn of 2004.

Portsmouth Crown Court has heard that 34-year-old Ayrton, who was previously called David, is alleged to have raped the teenager who had run away from home.

The jury was told that the incident happened in a garage in Portsmouth, Hampshire, containing a sofa and two chairs where the schoolgirl, described as a ''frequent runaway'', would stay when hiding from her family.

The court heard that the victim claims she was raped while a friend and her boyfriend were asleep inside the garage.

Ayrton denied raping the alleged victim or having sexual contact with her but did admit being in the garage with her and her friends for ''drinking and smoking''.

She said she had drunk four cans of Foster's lager that evening but had not consumed any vodka ''because I was on benefits at the time and didn't have enough money''.

Ayrton admitted she was sentenced at Bournemouth Crown Court in January 2014 for offences of possessing indecent photographs of children.

Ann-Marie Talbot, representing Ayrton, asked her why she had entered guilty pleas to these charges, to which the defendant replied: ''Because I was guilty of them.''

When asked by Ms Talbot if she had raped the girl in 2004, the defendant said: ''No.''

The court has heard that Ayrton has learning difficulties and lives at the Heywood Sumner House care home in Fordingbridge.

Ayrton was asked if she had confessed to being a paedophile to a care worker in 2014 and had admitted to raping a girl in a garage in the past, to which she replied ''No''.

She also denied saying to her: ''I have always known there was something wrong with me and I need help.''

The trial has heard that the rape prosecution was brought after the care worker reported the comments and the police approached the alleged victim.

Ayrton told the court that she believed the care worker had found out about the rape allegation from his case file as she had previously been interviewed about the incident by police.

Ms Talbot also asked the defendant if she had ''made any physical changes or enhancements'' to her body or was taking any medication regarding her sexuality, to which the defendant replied: ''No, I have not.''

Ayrton told the court that she had changed her name in August 2012 and had left home when she was aged 17.

The victim told the court she had shouted and sworn at the defendant, who had medium-length greasy brown hair at the time, in a bid to make him stop the alleged attack.

Ayrton denies one charge of rape between October and November 2004.

The trial continues.