or anti-villain if there is such a thing.
As defined on tvtropes: The Anti-Villain is a villain with heroic goals, personality traits, and/or virtues. Their desired ends are mostly good, but their means of getting there are evil. Alternatively, their desired ends are evil, but they are far more ethical or moral than most villains and they thus use fairly benign means to achieve it, and can be downright heroic on occasion.
So yeah, anti-villain is a thing. In order of preference for me: Anti-Villain, Villain, Hero, Anti-Hero.