Before becoming head of state, Carrillo held a number of public positions, including Judge and Chairman of the Supreme Court of Costa Rica, member of the Legislative Assembly of Costa Rica and member of the Congress of the Federal Republic of Central America.
Because of their strong character and that the assembly repealed in August of that year the Ambulance Act (the law that established the rotation of the country's capital among the four cities of San José, Alajuela, Heredia and Cartago), the cities of Cartago, Heredia and Alajuela took up arms against the government in mid-September, but were defeated after a civil war which lasted a fortnight.
He convened a constituent assembly, which, in November, declared that the state was separated from the Federal Republic of Central America, and thus Costa Rica became a sovereign country.
His efforts to open a path to communicate with the Central Valley Matina on the Caribbean coast, could not be satisfactorily completed, as the government of Francisco Morazán stopped work when they were well advanced.
In 1842 Francisco Morazán, former Federal President Central America, invaded Costa Rica and seized power.