A 17-year-old boy was held for two months at an adult prison in regional Western Australia before corrective services officials confirmed his age using his Medicare card, the Kalgoorlie Children’s Court was told.

The boy, who cannot be legally identified, appeared in court on Thursday afternoon after his detention at Eastern Goldfields Regional Prison. The prison was not named in court, but it is the only corrective services facility in Kalgoorlie-Boulder.

The South Boulder prison, 600km east of Perth, currently houses around 330 adult inmates.

Western Australia’s Department of Justice has declined to explain how the boy came to be detained in an adult prison. A spokesperson said: “The Department of Justice does not provide details about individual cases.

“The process for newly admitted prisoners includes collating information presented at the time of admission, from existing custodial records and the WA Police Force database.

“If an issue is identified, immediate action is taken to confirm their safety, and to address existing court orders, placement of the individual and the need for court action or transfer.

“In such an instance, assurance processes would be undertaken to establish how incorrect information was received, recorded and subsequently relied on, and to identify any necessary improvements to processes and controls.”

The boy appeared on stealing charges and has other matters before the court. He was granted bail to live with family in a northern Goldfields community and is due back in court on December 8.