His exit comes as political opponents had sought to remove him over remaining in office beyond the end of his term.