A New South Wales joint counter-terrorism team investigating extreme rightwing behaviour in the state has charged a man with a terrorism offence.

The 21-year-old man from Sanctuary Point on the NSW south coast was on Saturday charged with one count of acts done in preparation for, or planning, terrorist acts after a joint counter-terrorism team investigation.

The offence carries a maximum penalty of life in jail.

The 21-year-old allegedly attempted and planned to buy or acquire military equipment including firearms and items capable of making improvised explosive devices.

The Australian federal police assistant commissioner Scott Lee said in a statement on Monday that the decision to arrest the man was made to mitigate any immediate threat to the community.

He added that the man was arrested to prevent further planning that “could have resulted in a terrorist attack” in Australia.

Lee said the man was planning to disrupt an electrical substation on the south coast and looking to source material to construct an improvised explosive device.

Police said the investigation began last month when detectives became aware of a number of online posts allegedly containing an extreme rightwing and anti-government ideology.

Detectives on the weekend raided properties in the rural town of Parma, south-west of Nowra and Sanctuary Point after they became “concerned” about the escalating actions allegedly undertaken by the 21-year-old man in the past week.

Several electronic devices, tactical equipment and three paintball firearms were seized at the Sanctuary Point property while four registered firearms were taken from the Parma residence which police say is the home of an associate of the 21-year-old man.

Investigations into the links between the man and his “online and real-world associates” are ongoing, police said.

NSW police assistant commissioner Mark Walton said officers acted swiftly as the man’s behaviour online was of “significant” concern.

“This person had anti-government sentiment, he was antisemitic, he has neo-Nazi interests and he has anti-Indigenous interests,” he told reporters in Sydney on Monday.

He insisted there was no ongoing threat to the community.

The 21-year-old man is due to appear at Nowra local court later on Monday.