Sucre's attempts at reform were only partially successful because Bolivia lacked the administration to carry them out. Many Conservative Party criollos turned away when his reforms threatened to challenge the economic and social patterns of the colonial past. As opposition increased, the local nationalist elite came to resent the leadership of their Venezuelan-born president. The invasion of Bolivia by the Peruvian general Agustín Gamarra and an assassination attempt in April 1827 led to Sucre's resignation in 1828. Sucre left the country for voluntary exile, convinced that "the solution was impossible." Given troop command by Bolívar, however, Sucre routed General Gamarra's much larger force (8,000) in a decisive battle at Tarqui on February 27, 1829.