A 12-year-old girl who was "married" in an Islamic ceremony in her family's Hunter Valley home fell pregnant but miscarried, a court has heard.

The girl, who cannot be named for legal reasons, was examined at the Children's Hospital at Westmead after she complained of sharp right abdominal pain. Doctors found she had an ectopic pregnancy - where the fertilised egg implants outside the uterus - and miscarried.

The now 13-year-old's pregnancy was revealed in a statement of facts tendered to the NSW District Court during a sentencing hearing for a 27-year-old Lebanese university student, who also cannot be named for legal reasons.

In October last year the man pleaded guilty to one count of persistent sexual abuse of a child.

The charge carries a maximum penalty of 25 years jail. The man's student visa has been cancelled and he is being detained in Villawood Immigration Detention Centre.