In 1807, following the French invasion of Spain and the subsequent abdication of the House of Bourbon in Spain, pressed by Napoleon to give the crown to his brother Joseph, resulting in the destruction of the Spanish administration, many in Spain and in the American colonies created local resistance governments called Juntas. The dissolution of the Supreme Central Junta, following a series of military defeats in the Spanish troops promoted the creation of local juntas all throughout Latin America, which very soon consolidated the independentist ideas already in vogue. After the establishment of a junta in Cartagena de Indias on 22 May 1810, and in many other cities throughout the Viceroyalty, the Junta de Santa Fe was established on 20 July 1810, in what is often called the Colombian Declaration of Independence. The Junta adopted the name of "Supreme Junta of the New Kingdom of Granada", and first swore allegiance to Viceroy Antonio José Amar y Borbón, and appointed him as president, but then he was deposed and arrested five days later. After declaring independence from Spain the different juntas attempted to establish a congress of provinces, but they were unable to do so and military conflicts soon emerged.