The prosecutor told the court he put religious laws ahead of the laws of the state, and faces up to twenty years in jail if convicted.
Surrounded by family and friends 20 year old Tolga Cifci was released on bail from Burwood Court in Western Sydney.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
It's alleged he was one of a group of men who broke into an apartment early on Monday morning.
Police say a recent convert to Islam was held down and whipped for having gone drinking with friends, contrary to Sharia law.
The charges include maliciously inflicting actual bodily harm.
The magistrate described the charges as extremely serious: breaking into a man's home, and whipping him forty times with an electric flex.
He said if convicted the accused he would be sentenced to jail, but he was released on bail under strict conditions.
Sharia law is practised in many Muslim countries.
Two years ago there was an international outrcy when a woman in Sudan was sentenced to forty lashes for wearing trousers.
In May the federal government rejected out of hand a submission by the Federation of Islamic Councils asking for the right to conduct marriages and financial transations under Sharia.
The attack has angered others in the Muslim community, including Professor of Arab and Islamic Studies at the University of Melbourne, Abdullah Saeed
"Like other Muslims I was disgusted, I was horrified to see individuals taking the law into their own hands. Here in a country where there is no recognition of Islmaic criminal law or punishments how can they do it? They cannot", he said.
"This is a country where there is a legal system, there is a state... It's just not acceptable under any Islamic system that I'm aware of."
Until his next court appearance in six weeks Cifci is subject to a strict curfew and must live at his parents home.
Police have arrested and charged anothe rman in relation in relation to the attack, and are still seeking two others.

