he participated in the liberating expedition of peru and later become a colonel