His first term in office was served as temporary President between 1 September and 31 December 1863. Medina was then elected President in 1864. According to the 1848 constitution he was eligible for a second term in office. However in 1865 he convened a Constitutional Convention, which adopted a new constitution on 18 September. This restricted the President to a single term in office, as well as making the National Congressunicameral. The Convention made Medina the provisional President, which was confirmed in a December 1865 election.
In order to win a second term after the adoption of the new constitution. He convened a new Convention, which approved the changes to the constitution and also elected him President for a second term. However, following protests, he held a referendum on the issue, which was approved by over 95% of voters. However,on 26 July 1872 he was ousted from power after a revolt by the Liberals.
He provisionally served a third time between 12 August and 27 August 1876, and was later executed by firing squad in 1878 in Santa Rosa de Copán.