A Villawood Detention Centre detainee has pleaded guilty to the persistent sexual abuse of a 12-year-old girl he married in an Islamic ceremony.

The Lebanese man, 27, was on a student visa when he married the girl in the New South Wales Hunter Valley in January.

He was charged with more than 20 counts of having sex with a child under 14.

Burwood Local Court heard prosecutors had rolled those charges into the single charge of the "persistent sexual abuse of a child".

The man, who cannot be named, faced court via video link and his solicitor entered a guilty plea on his behalf.

The matter will return to court next week to set a sentencing date.

The man faces a maximum jail sentence of 25 years.

The court previously heard the girl's father gave permission for the marriage.

The father is still before the courts on separate charges.

A Muslim cleric who carried out the ceremony was fined $500 and deported to Pakistan.

The girl, who had since turned 13, and her younger sister were in the care of the Department of Family and Community Services.