The Spaniards forced Bolivar to retreat from Venezuela to the territory that later became Colombia. He took command of a Colombian force and captured Bogota in 1814. But new defeats led him to flee to Jamaica. In Haiti, he gathered a force that landed in Venezuela in 1816 and captured Angostura (now Ciudad Bolivar). He then became the dictator there.
Bolivar marched south in 1819. He defeated the Spaniards at Boyaca in 1819, liberating the territory of Colombia. He then returned to Angostura and led the congress that organized the republic of Gran Colombia. At first, Gran Colombia included what are now Colombia and Venezuela. Panama joined the republic in 1821, and Ecuador joined it in 1822. Bolivar became its first president on Dec. 17, 1819.
Bolivar crushed the Spanish army at Carabobo in Venezuela on June 24, 1821. Next, he marched into Ecuador and added that territory to the new Colombian republic. Bolivar became dictator of Peru in 1824.
Under the leadership of General Antonio Jose de Sucre, Bolivar's army won a victory over the Spaniards at Ayacucho in 1824, which ended Spanish power in South America. Upper Peru became a separate state, named Bolivia in Bolivar's honor, in 1825. The constitution that he drew up for Bolivia is one of his most important political pronouncements.
Bolivar hoped to form a union of the new South American nations against Spain, and to establish close relations between these nations and the United Kingdom. But the achievement fell short of his hopes. By 1830, the republic of Gran Colombia had split into three separate countries--Colombia (including Panama), Ecuador, and Venezuela. Feeling against Bolivar grew strong. He narrowly escaped assassination in Bogota. He resigned as president of Colombia in 1830.