Gankutsuou: The Count of Monte Cristo, written by Natsuko Takahashi and Tomohiro Yamashita, directed by Mahiro Maeda/GONZO, 2004
This retelling of The Count of Monte Cristo is set in the year 5053, in France. The art is very stylized, and GONZO was experimenting a lot with colors and textures in the animation.
A mysterious man calling himself the Count of Monte Cristo appears to young Albert Morcerf while Albert is on vacation on the moon colony, and the Count works his way into the Morcerf family's confidence when they return to Paris. The Count's secret identity is Edmond Dantes, who was Albert's mother's lover and who was unjustly imprisoned in the Chateau d'If.
In the Chateau d'If, Dantes met a demon, Gankutsuou, who made a deal for his freedom. Dantes is free, and he's seeking revenge.
I haven't actually read the classic novel, so I don't know how closely it follows the original. I don't think there are any literal demons involved in Dumas' version, just the usual figurative ones. This version focuses on Albert and his friends, and the new relationship between Albert and the Count.
It was originally released in the US by Geneon, who were among the casualties of the anime bubble burst. Funimation rescued the license and has released it in a value pack. You can watch all 24 episodes on Crunchyroll or hulu.