sentences:  Later, in Guatemala, he supported independence and became the first president of a united Central America extending from Soconusco (in Chiapas) through Guatemala, El Salvador, Honduras, Nicaragua and Costa Rica.He arrived in Peru in 1783 as a Spanish military officer.There he participated in the repression of the indigenous rebellion headed by Túpac Amaru.