Following the occupation of Spain during the Napoleonic Wars, Cundinamarca was one of the states (such as United Provinces of South America (current Argentina) and the First Republic of Venezuela) who replaced its viceregal government with a local junta in the name of the deposed Ferdinand VII.
[1] Antonio Nariño, who had been appointed as Mayor of the city of Santafé on August 30, 1811, started pushing for a strong centralist position from the newspaper he created, La Bagatela (or The Triffle).
[1] While Cundinamarca, including the old capital and administrative machinery, advocated the establishment of a strong centralist government, other parts of the old viceroyalty banded together as the United Provinces of New Granada to support a federal structure.
Unable to unify the country in a centralist state, and fearing the loss of power that would come as a consequence of federalism, Cundinamarca under Nariño became embroiled in Civil War against other provinces, particularly Tunja, where the Federalist Congress had settled.
[4][5] In July 1813, and motivated by his victory over the federalists, General Nariño began an intensive military campaign against the remaining Spanish and Royalist forces in the south, intending to reach Pasto and eventually Quito.