A backyard Islamic marriage between an 18-year-old man and a 15-year-old girl was only discovered when the young bride took herself to a western Sydney hospital believing she had suffered a miscarriage, police allege.

Mustafa Abdel Ghany, 19, was charged on Wednesday with marrying a 15-year-old girl in the backyard of her father's Sydney home in November.

A sheikh allegedly officiated over the ceremony and the couple moved into a granny flat at Abdel Ghany's parents' home in south-west Sydney soon after.

Detectives from the Child Abuse Squad were alerted to the marriage when the 15-year-old attended Bankstown Hospital on January 20 believing she had suffered a miscarriage.

It is the first time the state's Child Abuse Squad has charged a man with marrying an underage girl.