The end of the French invasion of homeland Spain in 1814 allowed the preparation of a large expeditionary force to the American provinces under general Pablo Morillo, with the goal to regain the lost territory in Venezuela and New Granada. As the war reached a stalemate on 1817, Bolívar reestablished the Third Republic of Venezuela on the territory still controlled by the patriots, mainly in the Guayana and Llanos regions. This republic was short-lived as only two years later, during the Congress of Angostura of 1819, the union of Venezuela with New Granada was decreed to form the Republic of Colombia (historiographically Republic of Gran Colombia). The war continued for some years, until full victory and sovereignty was attained after Bolívar, aided by José Antonio Páez and Antonio José de Sucre, won the Battle of Carabobo on 24 June 1821. On 24 July 1823, José Prudencio Padilla and Rafael Urdaneta helped seal Venezuelan independence with their victory in the Battle of Lake Maracaibo. New Granada's congress gave Bolívar control of the Granadian army; leading it, he liberated several countries and founded the Republic of Colombia (Gran Colombia).