He assumed the Presidency of Peru during an epoch of civil war, which divided Peru between the followers of Ramón Castilla's government and those of Domingo Elías Carbajo.
After completing his elementary studies, he travelled to Madrid and Paris to continue his education. He returned in 1825 and made a living from agriculture in the Ica Region, where he started a large cultivation of cotton and vine. This epoch coincided with the arrival of Chinese coolies to replace the declining work of African slaves in 1849.
After the defeat of the Peru-Bolivian Confederation during the decade of the 1840s, anarchy in Peru became rampant. In 1843, during the government of Manuel Ignacio de Vivanco, Elías was named prefect of Lima. When Vivanco headed to southern Peru to confront the constitutionalist movement of Ramon Castilla, Elías was assigned the governorship of the northern Peruvian provinces. The internal Peruvian conflict was still undecided between the military factions of the country: Vivanco's and Echenique's against Castilla's and San Román's .
During this traumatic and polarizing period of Peruvian history, writes the Peruvian historian Jorge Basadre Grohmann, the “civil Elías” decided to convert himself into the leader of the tiredness of the country upon the "ever-lasting internal war". Elías declared himself the "Political and Military chief" of Peru on July 17, 1844.
When Echenique's forces threatened to return to the capital, Elías declared the Lima Province in state of assembly, which meant the total suspension of labor and readiness of his able followers to take arms. The public employees, schools, and businesses formed regiments. All of Lima and even guarding members of the provinces of Pisco, Ica, and Callao prepared to confront Echenique who, in the end and to everyone's astonishment, never arrived. This history week became known in Peru as the "Magna Week."
Soon after, Elías ended his government upon the triumph of Castilla over Vivanco. Elías occupied various public posts such as minister, deputy of Ica (1845) and even a candidate for the Presidency of Peru in the controversial elections of 1851, when he was defeated by Echenique. During the latter's government, he fought rampant corruption and above all an internal debt through his famous letters against the government. For these actions Elías was exiled to Guayaquil, Ecuador.
Elías did not cease in his actions to reach the government and returned to Peru through Tumbes to launch an unsuccessful coup d'état. He tried again from his native Ica but was again defeated in Soraja (1854. Finally, with the success of Castilla, he was named Hacienda Minister and later ambassador to France. He returned to Peru in 1858 to launch an unsuccessful presidential campaign. Thereafter Elías retired from politics and made a living from commercial and agricultural activities.
He died in Lima in 1867.