A Victorian policeman held a revolver to the head of a young girl while he had sex with her, a court has heard.

The former officer, who is facing dozens of sex charges, put the same girl in a police cell for three hours when she was eight and made her perform sex acts on him, the Melbourne Magistrates Court heard on Friday.

The girl was also allegedly taken in the back of a divisional van to bushland where she was again made to perform sex acts on the policeman.

It is also alleged the former officer went to see a 10-year-old boy as part of his police duties and touched the boy's genitals.

Police allege the man held a rifle to the head of another boy and threatened to kill him.