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.