fall of the Empire in early 1823. The subsequent government, the Supreme Executive Power placed him back on the Audencia until Peña y Peña was elected by a majority of the state legislatures to the Supreme Court and made a member of that body on 25 December 1824. He would remain at that post intermittently until his death. During the Centralist Republic of Mexico, he was named Minister of the Interior by President Anastasio Bustamante in 1837 and the following year he was named to the Supreme Moderating Power, an executive council that was meant to be above even the president. In this post his sought to counter the tendencies of the federalists who were backed by part of the military and counted upon considerable public support. He gave a detailed report on constitutional reform, and played a role in reforming the law for punishing robbery. Peña y Peña was also professor of public law at the University of Mexico and towards the end of 1841 he was given the task of writing the civil code and civil procedure and named a member of the legislative junta which wrote a new constitution, the Bases Orgánicas. In 1843 he was named to the council of state and also elected to the senate being reelected, in November 1845 in which he once again was named Minister of Foreign Relations, being in agreement with President Herrera's aims in seeking to avoid war with the United States. He was assigned to negotiate an extradition treaty with Spain, and when Herrera was overthrown in December 1846, Peña y Peña returned once again to his post on the Supreme Court. First Presidency He would be in this post when the Mexican American War broke out in April 1846. A year later, as the Americans approached the capital, President Santa Anna, to provide against the possibility of being killed or captured, issued a decree on 7 September 1847 appointing his substitutes, which he sent to President of the Supreme Court, Peña y Peña. On 16 September, he held a council of war, and resigned the presidency, decreeing that the presidency should now be vested in a triumvirate led by the President of the Supreme Court. Peña y Peña accepted the presidency but rejected the provision of a triumvirate as unconstitutional. He repaired to Toluca and then to Querétaro where he assumed the office of provisional president on