Nasheed resigned in 2012, four years into his presidency, amid public opposition to his order for the military to detain a judge. Nasheed lost to Yameen in the 2013 presidential election and then was jailed for ordering the judge's detention. Since being elected, Yameen has rolled back much of the democratic gains and freedoms.