A white supremacist admitted to stockpiling guns and plotting a mass shooting out of sexual frustration.

Michael James Holt appeared Friday in an Australian court for a sentencing hearing after pleading guilty to a variety of firearms charges after police found his cache of homemade guns two years ago at his home, his grandfather’s home and a hotel, reported The Sydney Morning Herald.

ADVERTISEMENT

The 26-year-old later pleaded guilty to possessing and sharing child pornography after police found those images while investigating the shooting plot.

Prosecutors said the New South Australia man admitted to planning a mass shooting at a mall and also wanted to shoot teachers and students at a nearby school.

Holt admitted to an “infatuation” with neo-Nazi ideology and told a counselor that he believed Adolf Hitler was “the greatest person to live,” prosecutors told the sentencing judge.

Prosecutors presented more than 40 pages of text messages from Holt revealing his plan to shoot tourists and police, the newspaper reported — and he blamed his violent urges on his inability to find a willing sexual partner.

“Gonna have to just start killing people if I don’t get laid soon,” Holt said in one text message.

ADVERTISEMENT

Defense attorneys said Holt had been obsessed with guns since he was 5 years old, partially as a result of his autism.

The judge compared Holt to a mass shooter in Port Arthur who killed 35 people in 1996, and said his obsessions and interests were “deeply disturbing.”

Holt will be formally sentenced Sept. 29.