The cabildo was the legal representative of the municipality and its vecinos before the Spanish Crown and so it was among the first institutions established by the conquistadors themselves after, or even before, taking over an area.
That phrase is often abbreviated Exc.mo Ay.to The Castilian cabildo has some similarities to the ancient Roman municipium and civitas, especially in the use of plural administrative officers and its control of the surrounding countryside, the territorium, but its evolution is a uniquely-medieval development.
In areas in which the old territoria survived, the Visigothic kings appointed a single officer, called either a comes or a iudice, to replace the defunct municipia or civitates.
Qadis heard any cases that fell under the purview of Sharia law, and sahibs oversaw the administration of the various other areas of urban life, such as the markets and the public order.
As fortified areas grew into urban centres, or older cities were incorporated into the expanding Christian kingdoms of Portugal, León and Castile, kings and sometimes local lords granted the cities various levels of self-rule and unique sets of laws (the fueros) and made them the administrative centre of a large terminus or alfoz, which was analogous to the ancient territorium.
As part of the same process, a municipal council (the consell) with different attributes and composition also evolved in the neighboring Kingdom of Aragon during this period.
Other officers were the alférez real (royal standard-bearer), who had a vote in cabildo deliberations and would substitute the alcalde if the latter could not carry out the functions of his office; the alguacil mayor, who oversaw local law enforcement; the fiel ejecutor, who was the inspector of weights, measures and markets, in charge of the supplies of the city and oversaw municipal sanitation; the procurador or city attorney; and a scribe.
Other offices, such as oidores of the audiencia, corregidores (in the places in which they continued to exist after the Bourbon Reforms) and intendant, also saw a rise in the proportion of peninsulares being appointed.
Soon enough, cabildos became the centre of power for creoles, as evidenced in many of the clashes, usually with the peninsular-dominated audiencias, in the period leading up to the Spanish American Wars of Independence.