In early 1945, Aguirre transferred power to Castaneda Castro. In January 1945, Castaneda Castro was elected president, with the backing of the elites that had supported Hernández Martínez. He contested the election as a candidate of "Partido Agraria", or the Agrarian Party. He faced no opposition in the election, and the country remained under martial law during the entire process. Castaneda Castro had previously served as the interior minister in the government of Hernández Martínez, as had many of the ministers that Castaneda Castro appointed.