The region of Panama was part of the Spanish empire during the wars of independence against the Spanish. After the patriot victory at the Battle of Carabobo, Panamanians decided to join Gran Colombia. Up until this point, Panama had remained within the Spanish monarchy and had avoided the troubles afflicting the rest of the Viceroyalty of New Granada. On November 28, 1821 Panama was voluntarily annexed to Gran Colombia under the Constitution of Cúcuta, which had been promulgated on August 30, 1819.