A man was on bail when he walked into the Melbourne city headquarters of the Australian Border Force and fired a gun in the bathroom, court documents allege.
Shannon Jenkins, 38, is accused of entering the Docklands building on Monday armed with two guns before firing at the ceiling of a shower or toilet cubicle.
He did not apply for bail in Melbourne Magistrates Court on Tuesday, charged with several offences including firearms possession, criminal damage, assaulting two police officers and reckless conduct endangering serious injury.
Jenkins, of no fixed address, was on bail when the alleged offences were committed, according to court documents.
Lawyer Susie Crowe said Jenkins had faced the drug court on other matters and had subsequently been detoxing.
"If he was to plead guilty a number of the charges could be resolved," she told Magistrate Susan Wakeling.
Jenkins is alleged to have entered the ABF building with a cut-down rifle and a pump action shotgun, and fired at the ceiling of the toilet/shower cubicle before giving police a fake name and assaulting officers.
Home Affairs Minister Peter Dutton earlier told reporters the man "wasn't a client of the Australian Border Force".
"(He) entered into the foyer of the ABF facility there and there was an incident then that the Victorian Police responded to," Mr Dutton said.
Jenkins is also accused of trespass and stealing items from a Maribyrnong residence on Sunday, when he allegedly took mobile phones, a passport and identity documents.
Jenkins appeared in court with a cut to his cheek and told the magistrate he had seen a nurse.
He is due to reappear on May 29.