SYDNEY (Reuters) - An Australian man was charged with a terrorism offence on Thursday after walking into a politician's electorate office with plans to kill him, the authorities and local media said.

The 19-year-old man entered the office of New South Wales state parliamentarian Tim Crakanthorp in Newcastle, about 170 km (105 miles) north of Sydney, on Wednesday before being arrested in a nearby museum with weapons and tactical equipment, the Australian Broadcasting Corp and the Sydney Morning Herald reported.

He was held overnight and charged on Thursday with "acts done in preparation for, or planning, for terrorist act", a police statement said.

In a hearing where the man appeared via videolink, acting magistrate Anthony Spence told the court that the man was accused of attending Mr Crakanthorp's office "with intent to kill him due to his status as a member of parliament [and] in preparation of planning a terror attack", the ABC reported.

A court representative named the accused as Jordan Patten, adding that Patten did not apply for bail and it was formally refused. Patten was not yet required to enter a plea.

The police statement said the accused had circulated a document to public figures and media outlets, without giving further detail. The ABC and the Herald reported Patten had shared a 200-page manifesto which detailed multiple grievances including anti-immigration and anti-diversity views.

Crakanthorp said in a statement he and his staff were unharmed in what he called a very serious incident.

Patten is next due appear in court on Aug. 21, the court official said.

Gun and knife violence is rare in Sydney, one of the world's safest cities, but in recent months there have been a spate of stabbing attacks.

In April six people were killed in a mass stabbing attack at a shopping centre in Sydney in which police shot dead the attacker.

A few days later a teenager allegedly stabbed a Assyrian Christian bishop mid-service in Sydney. The teenager and five others have been charged with terrorism-related offences.

(Reporting by Byron Kaye; Editing by Michael Perry)