During the first term as president, Carrera brought the country back from extreme conservatism to a traditional moderation; in 1848, the liberals were able to drive him from office, after the country had been in turmoil for several months. Carrera resigned of his own free will and left for México. The new liberal regime allied itself with the Aycinena family and swiftly passed a law ordering Carrera's execution if he returned to Guatemalan soil.