The viceroyalties of the Spanish Americas and the Spanish East Indies were subdivided into smaller, autonomous units, the Audiencias (tribunal with the authority to judge), and the Captaincies General (military districts), which in most cases became the bases for the independent countries of modern Hispanic America. These units gathered the local provinces which could be governed by either a crown official, a corregidor (sometimes alcalde mayor) or by a cabildo or town council.