A South West primary school was forced into lockdown when a man armed with an axe started acting aggressively towards the public on Friday morning.

Police have charged a 37-year-old man with two counts of trespass and being armed in a way that may cause fear after he allegedly entered the backyards of two homes in Dunsborough before heading towards Dunsborough Primary School on Turner Street.

The man was allegedly in possession of an axe “protruding from his backpack” when he yelled and screamed at members of the public, within hearing distance of students, about 9.25am on Friday.

“As a precaution, school staff enacted lockdown procedures in consultation with police,” a spokeswoman said.

“Members of the public challenged the man, who subsequently left the area.

WA’s biggest courts and crime stories to your inbox

Sign-up to our weekly newsletter for free

Sign up

“He was apprehended by police a short time later.”

The man faced Busselton Magistrates Court on Friday facing five charges, which also included possession of amphetamine and disorderly behaviour in public.

He was remanded in custody scheduled to appear on September 8.

Get the latest news from thewest.com.au in your inbox.

Sign up for our emails