An alleged wig-wearing gunman has briefly faced court after a bizarre attempted robbery.

Police say Haydn Smith was wearing the long black wig and a surgical mask when a security guard spotted him entering the loading bay of a Sunnybank shopping centre on Sunday morning.

They say the guard followed Smith, who fled through a car park and into the yard of a nearby home.

As he removed his disguise behind a rainwater tank, two off-duty police officers confronted and restrained him.

Smith, a 52-year-old Victorian, was searched and found to be carrying a semi-automatic handgun, ammunition and other undisclosed items.

He has been charged with attempted armed robbery, contravening a direction and unlawful possession of weapons.

Smith appeared briefly in Holland Park Magistrates Court on Monday. He made no application for bail and his matter was adjourned until March 4.