In the Napoleonic era, junta (Spanish pronunciation: ['xunta] ) was the name chosen by several local administrations formed in Spain during the Peninsular War as a patriotic alternative to the official administration toppled by the French invaders. The juntas were usually formed by adding prominent members of society, such as prelates, to the already-existing ayuntamientos (municipal councils). The juntas of the capitals of the traditional peninsular kingdoms of Spain styled themselves "Supreme Juntas", to differentiate themselves from, and claim authority over, provincial juntas. Juntas were also formed in Spanish America during this period in reaction to the developments in Spain.
The juntas were not necessarily revolutionary, least of all anti-monarchy or democratically elected. By way of example, the junta in Murcia, comprised the bishop, an archdeacon, two priors, seven members of the old city council, two magistrates, five prominent local aristocrats, including the Conde de Floridablanca (Charles III's prime minister) and five high-ranking officers (either retired or still serving). Likewise, the junta of Ciudad Rodrigo, a strategic town near the border with Portugal, comprised "nine serving officers, including the pre-war governor and the commanders of all the units that had made up the garrison; five retired officers, of whom two were brigadiers" and, among others, the bishop, and seventeen members of the clergy.
Realizing that unity was needed to coordinate efforts against the French and to deal with British aid, several supreme juntas--Murcia, Valencia, Seville and Castile and León--called for the formation of a central one. After a series of negotiations between the juntas and the discredited Council of Castile, which initially had supported Joseph I, a "Supreme Central and Governmental Junta of Spain and the Indies" met in Aranjuez on 25 September 1808, with the Conde de Floridablanca as its president. Serving as surrogate for the absent king and royal government, it succeeded in calling for representatives from local provinces and the overseas possessions to meet in an "Extraordinary and General Cortes of the Spanish Nation", so called because it would be both the single legislative body for the whole empire and the body which would write a constitution for it. By the beginning of 1810, the forces under the Supreme Central Junta's command had suffered serious military reverses--the Battle of Ocaña, the Battle of Alba de Tormes--in which the French not only inflicted large losses on the Spanish, but also took control of southern Spain and forced the government to retreat to Cádiz, the last redoubt available to it on Spanish soil (see the Siege of Cádiz). In light of this, the Central Junta dissolved itself on 29 January 1810 and set up a five-person Regency Council of Spain and the Indies, charged with convening the Cortes. Therefore, the system of juntas was replaced by a regency and the Cádiz Cortes, which established a permanent government under the Constitution of 1812.
The term was also used in Spanish America to describe the first autonomist governments established in 1809, 1810 and 1811 in reaction to the developments in Spain. By the time the delegates were to be chosen for the Cádiz Cortes, some of the American provinces had successfully established their own juntas, which did not recognize the authority of either the supreme central one or the regency. Therefore, they did not send representatives to Cádiz, but rather the juntas continued to govern on their own or called for congresses to set up permanent governments. This development resulted in the Spanish American wars of independence.