A Sydney man accused of appearing naked before a 12-year-old girl sleeping in his home during the 1980s has been acquitted.

A legal “oddity” has led to the acquittal of a Sydney man accused of indecency towards a 12-year-old girl because his crime might have been more serious than his charge.

Daniel Hayman, 49, pleaded not guilty to committing one act of indecency against a person under 16 at his Bondi Junction home in Sydney’s east in late 1989.

Downing Centre Local Court heard on Thursday that Hayman knew his alleged victim through Bondi’s Jewish Yeshiva Centre, where he was a member and sometimes supervised youths while doing volunteer work.

The girl’s family lived in Brisbane but she was boarding at Hayman’s family home while she attended Yeshiva Ladies College at the centre.

The crown alleged that during the early hours of one morning Hayman, then 25, crept completely naked into his living room where the girl was sleeping on the sofa bed.

He then allegedly sat down on the adjoining couch, leaned towards her and touched the quilt she was sleeping under.

The alleged victim, now 37, described how she “wrapped herself up really tight” inside the quilt after she was woken by Hayman and felt a hand touch her somewhere.

After he left the room, she dressed quickly in her school uniform and left at about 4.30am.

“I was scared. I just wanted to get away from him,” she said.

From a phone booth she rang a friend from the Yeshiva Centre, Michael Berkowitz, to tell him what had happened before calling her parents.

That morning she recounted the incident to Rabbi Baruch Lesches at the Yeshiva Centre.

The incident went unreported until the alleged victim contacted police in August 2013.

In a police interview recorded after his November arrest, Hayman said he didn’t recall the girl living at his home.

Explaining his decision to acquit Hayman, Magistrate David Williams cited a legal “absurdity” whereby he was bound to retrospectively apply an old law in place at the time of the incident.

It ruled if there was any possibility the incident constituted the more serious crime of indecent assault, the accused must be acquitted of the less serious charge of committing an indecent act.

“It is an oddity of the law, putting it in the mildest of terms,” Mr Williams said.