The first antecedents of the arrival of the Spanish army to the American territory were the conquest of the overseas territories. On November 18, 1518, Hernán Cortés departed from the Port of Santiago de Cuba, his army was composed of 518 infantrymen, 16 horsemen, 13 arquebusiers, 32 crossbowmen, 110 sailors. In the course of his campaign, his force was considerably reduced due to the imperative conditions of the voyage.
On February 27, 1519, Cortes' expedition arrived at Cozumel, during the first months it advanced towards the central region. On November 8 of that same year, he began the incursion to Tenochtitlán with 400 Spaniards, 15 horses, and 7 cannons. From that moment on and during the entire Viceroyalty period, hundreds of men-at-arms, expeditionary troops, and militias of New Spanish origin arrived steadily.
The Viceroyalty Government was gradually strengthened, one of the mechanisms to maintain order was to adopt the structure of the administration system of the Spanish Crown, for which a Viceroy was appointed as the King's authority in Overseas, during the 16th century, he received the position of Captain-General in which he was given the command and organization of the Armed Forces and the Naval Fleets.
One of the functions of the Viceroy was to recruit and supply his forces, as well as to build, conserve and sustain the presidios and fortresses. He also had to solve problems related to military justice, a position in which he received support from the war auditor, who also served as one of the oidores ("judges") of the Royal Audiencia or was directly advised by the war board.
The Viceroy could delegate responsibilities to the governors by granting them the distinction of Captain-General and to the northern Alcaldes Mayores Mayores as Capitanes a Guerra to exercise the functions of military chiefs in their respective jurisdiction, among other lieutenants. In the north, the missionaries also participated in the defense works of the zone, in addition to the presence of military specialists that assisted in the defense and construction works, such as the Military Engineers.
Although the protection of the colonies in America was always a priority, the army was not yet fully instituted in New Spain, those in charge of maintaining peace were civilian organizations and provincial or urban militias that were later integrated into the presidio companies, border vigilance constructions in which fortifications were established with troops.
It is worth mentioning that military service was an obligation that existed in the peninsula and passed to New Spain, although it excluded the indigenous people as much as possible to prevent them from being able to rebel. Between 1542 and 1552 the Crown confirmed the military obligation of encomenderos ("commissioners"). However, at the end of the 17th century, this responsibility was reduced to the payment of expenses for the defense with which they supplied the troops.
In 1762, due to the intervention of the English in the Seizure of Havana, the need arose to establish a permanent army in New Spain, the Spanish Monarchy ordered Francisco de Villalba y Ángulo to create an army capable of repelling any aggression. Villalba arrived in Veracruz in 1764, marking the beginning of the organization of the regular army.
But the organization and administration of the defense during the Viceroyalty embodied a series of problems since its creation because the activities of the army intensified social differences and encouraged the distrust of the peninsular soldiers towards the novo-Hispanics. Another element that influenced the establishment of the Viceroyalty Army was the constant pressure exerted by local authorities such as town councils, mining groups, ecclesiastical authorities, and landowners.
At the beginning of the 18th century, the guidelines for change were emanated from the Bourbon Reforms, which revealed the need to reorganize the American defense, which led to the formation of garrisons, displacing the old presidio companies for regular units integrated by Companies, Battalions, and Regiments equipped with Major Plans and Garrison Services. In addition, recruitment and promotions were regulated. By disposition of the Castilian Councils, engineering and mathematics academies were implemented to professionalize the Garrison Services.
The organization of the Viceroyalty Army was integrated by the following units and auxiliary militias:
Fixed units in the main American cities that acquired identical structures to the peninsular units.
Army of reinforcement or also called the army of operations in the Indies, composed of peninsular units sent temporarily to the other side of the sea as reinforcement of some places with threats of invasion.
Militias or set of regulated units (disciplined) and of territorial character that included the total of the male population of each jurisdiction between 15 and 45 years considered as a reserve army.