A Muslim cleric living in Australia on a religious visa believed he didn't do anything wrong by "marrying" a 12-year-old girl to a 26-year-old man because the union was never officially registered.

Muhammad Riaz Tasawar, 35, of Mayfield, appeared before Parramatta Local Court on March 19 where Magistrate Peter Miszalski accepted the plea to the offence of solemnisation of a marriage by an unauthorised person.

He was fined $500 and is in immigration detention awaiting deportation to Pakistan upon the cancellation of his Religious Leaders visa.

Tasawar, employed as the imam at the Mayfield mosque in Newcastle, was approached by a 26-year-old university student in January to perform an Islamic marriage ceremony in the girl's backyard.

The sheikh attended the family's Raymond Terrace home on January 12 and met with the 26-year-old man, his 12-year-old bride-to-be, the girl's father, her younger brothers and sister and another man.

The group all acted as witnesses to the marriage which was conducted by Tasawar.

"At the conclusion, they drank and ate together before the accused and Shoaib [a friend of the accused] left," according to an agreed statement of facts.

Police were made aware of the underage marriage when, a month later, the 26-year-old man, applied at Centrelink to become the child's guardian.

He was arrested and charged with 25 counts of sexual intercourse with an underage child. The girl's father, 61, has also been charged. Police allege he allowed his daughter to be "joined in an illegal union" in his Hunter Valley home on January 12 and to start a sexual relationship with the man.

When Tasawar was arrested in February, he told police he didn't believe the marriage was a "full marriage".

"In his view, he did not believe it was a full marriage because he had not officially registered it... however throughout the interview [he] referred to it as a marriage," the agreed facts said.

The sheikh, the husband and the bride's father all believed the marriage was legitimate and official, police allege.

The 26-year-old, who was was living in Australia on a student visa, has also had his visa cancelled.