One of two 12-year-old boys accused of raping a six-year-old girl at a Sydney northern beaches primary school has pleaded not guilty.

The boy’s lawyer, James Viney, entered not guilty pleas on the boy’s behalf on Thursday to four counts of aggravated sexual assault and two of having sexual intercourse with a girl under 10 during school hours.

The boy, who was accompanied by his parents at Hornsby children’s court, had his bail varied so he could go on a family holiday to Queensland. The magistrate, Louise McManus, excused the boy from attending on his next court date, 24 November.

Four of the offences allegedly occurred between 24 June and 1 July. He is accused of three counts of indecent assault aggravated by taking place in the company of the other boy and one of sexual intercourse with a person under 10.

The remaining offences allegedly occurred on 16 August between 8am and 4pm, involving indecent assault and sexual intercourse with the six-year-old girl.

The other boy is due to appear in the Hornsby court on 20 October.