He lost public support after he declared a state of emergency and fired several judges who planned to rule on the legitimacy of his presidency .