The outgoing president says the action will prevent "unjustified... politically motivated prosecutions".