A corregidor (Spanish: [korexiˈðoɾ]) was a local administrative and judicial official in Spain and in its overseas empire. They were the representatives of the royal jurisdiction over a town and its district.
He was the highest authority of a corregimiento. In the Spanish Americas and the Spanish Philippines, a corregidor was often called an alcalde mayor. They began to be appointed in fourteenth century Castile.
The idea of appointing crown officials to oversee local affairs was inspired by the late-medieval revival of Roman law. The goal was to create an administrative bureaucracy, which was uniformly trained in the Roman model.  In spite of the opposition of council towns and the Cortes (Parliament), Castilian kings began to appoint direct representatives in towns during fourteenth century. They were also called jueces del salario or alcaldes veedores but the term corregidor prevailed. The word regidor often means town councillor in the Spanish language. Thus, co-regidor was the position intended to co-rule the town together with elected councillors.
The first monarch to make extensive use of corregidores was Alfonso X, who ascended to the throne at the age of eleven. In order to consolidate royal authority and reward the newer nobility and certain great magnates who supported him he greatly expanded the use of the office. Some bishops and local lords were given the right to appoint corregidores in their territories. Henry used them mostly in Andalusia, the Basque provinces and Galicia, areas where royal power was weakest.  The definitive consolidation of the institution occurred during the reign of the Catholic Monarchs (1474–1516). Corregidores were crucial for the state building process that both monarchs ushered in. Their job was to collect taxes, to report to the crown on the state of affairs in the area, and to ensure that royal jurisdiction was not interfered with by members of the church or the nobility. From 1480 onward, they—and all subsequent Spanish monarchs—never again appointed a noble corregidor and instead relied exclusively on commoners with legal training to fill this office. 
As representatives of the royal power, corregidores administered justice, both criminal and civil, in the first instance (or in appeal in districts with alcaldes ordinarios), presided over the town council and ruled a district called a corregimiento. They were audited and controlled through the juicio de residencia (a general audit and review at the end of their term in office) or by means of visitas (literally, 'visits'; more accurately, 'inspections'), which could occur at any point in their term in response to complaints. The corregimiento became the basic unit of state administration in early modern Spain.
After the War of Succession, the new Bourbon kings introduced them into the Aragonese territories, replacing the bailes and vegueres, who, nevertheless, had very similar functions to Castilian corregidores.
The institution was established also in Spanish America during the conquest and the Spanish Philippines, where it were also known by the names justicia mayor and alcalde mayor (not to be confused with the alcaldes ordinarios of the cabildo). In Indian areas the office was known as the corregidor de indios. Corregidores essentially had the same powers and duties as governors (gobernadores), except that whereas the latter ruled over a province-sized area (called variously a gobernación or a provincia), the corregidor administered a district-sized corregimiento. The corregidores were introduced in the mid-16th century to replace the encomiendas, which had become a source of autonomous power for the settlers. It was a decades-long process. The corregidores were given this privileged position either due to having influential families in Spain, or through paying the crown and in return being appointed.  The reformed Audiencia of New Spain began implementing them in the 1530s, but they were not successfully set up in the Viceroyalty of Peru until the administration of Toledo. As the encomiendas were phased out, corregidores oversaw most of the local repartimientos. Corregidores were the pillar for the crown, and the system of colonial domination. whether it was a cacique or another representative that was used by the Spanish: as a broker between the indigenous Indians, and the Spanish conquerers, they answered to these corregidores. As a crown appointed official, they were served as a intermediary within the crown, the viceroy who was the top of the colonial administration, and of the riches of the Americas. The corregidores ensured that the product of indigenous labor such as farming, mining, sweatshop produce and other production would be handed to the Spanish. The corregidores also served to manage the demands of landowners and merchants, who were eager to take the maximum amounts of profits from indigenous labor. One huge issue was that the indigenous population, due to demands from the higher ups, could not reach the large quotas and were dying due to newly brought diseases from the Europeans that they were not immune to, as well being overworked, and the brutality that the European colonizers conducted. Appointed by the crown, The corregidores served as the crown official, overseer, account taker, negotiator, and slave driver. The corregidores was known to be the wealthiest, powerful and hated official in the colony. 
By law neither corregidores nor governors (nor viceroys, for that matter) could be persons who resided in the district in which they ruled. In theory they should have not developed ties to the locality in order for them to remain disinterested administrators and judges. For this reason they were also forbidden to marry in their district, although they could apply for exemptions from this restriction. In reality, however, they did become enmeshed into local society, especially through financial ties, since their pay was based on a proportion of local royal revenues, and this was often an insufficient amount to cover living costs, much less the costs incurred in traveling to America. Corregidores often invested in the local economy, received loans from locals, and could abuse the reparto de comercio monopoly they oversaw, which often led to corruption.
Although nominally under the viceroys, the long distances from the viceregal, and even provincial capitals, meant that most corregidores acted independently. Since their office held both police power (as the main local administrative institution) and judicial power (as the court of first instance) in rural areas, corregidores were very powerful persons. Because most of the corregidores in the Americas were not legally trained, they were assisted by lawyers who served as their asesores, or "advisers." If their district were large enough to require it, they were further assisted by subordinate delegates, called tenientes (lieutenant corregidores). In municipal areas with a cabildo, corregidores were to work with the council—for example, they recorded the annual election of alcaldes ordinarios and other council officers—but they could not hear cases in the first instance, which was the duty of the alcaldes ordinarios. In these cases, corregidores functioned as the first court of appeals, instead.
- Baskes, Jeremy. Indians, Merchants, and Markets: A Reinterpretation of the Repartimiento and Spanish-Indian economic relations in Colonial Oaxaca. Stanford: Stanford University Press 2000.
- Gibson, Charles. The Aztecs Under Spanish Rule. Stanford: Stanford University Press 1964.
- González Alonso, Benjamín: El corregidor castellano (1348-1808), Madrid: Instituto de Estudios Administrativos, 1970
- Haring, C. H. The Spanish Empire in America. New York: Oxford University Press, 1947, 128-134
- Lohman Villena, Guillermo. El corregidor de indios en Perú bajo los Austrias. Madrid: Ediciones Cultura Hispanica 1957.
- Lunenfeld, Marvin: Keepers of the City: The Corregidores of Isabella I of Castile (1474-1504), Cambridge University Press, 1987
- Moreno Cebrián, Adolfo. El corregidor de indios y la economía peruana del siglo XVIII (los repartos forzosos de mercancías). Madrid: Instituto Gonzalo Fernández de Oviedo 1977.
- Livermore, Harold (1958). A History of Spain. New York: Grove Press. p. 168.
- Hillgarth, J. N. (1976). The Spanish Kingdoms, 1250-1516. Volume I: 1250-1410, Precarious Balance. Oxford: Claredon Press, Oxford University Press. pp. 404–405. ISBN 0-19-822530-X.
- Harold, A History of Spain, 189.
- Meade, Teresa (2016). A History Of Modern Latin America:1800 to the present. Wiley-Blackwell. pp. 26, 27, 28. ISBN 978-1118772485.