How did Spanish become Panama's official language?

When Spain colonized panama in the 1500's, they brought spanish with them. It's stayed there ever since.