Ja'far ibn Yahya al-Barmaki, Grand Vizier of Caliph Harun al-Rashid, 767-803 AD. He sponsored the academy which was translating Greek works (including Aristotle) into Arabic, and convinced the Caliph to open the first paper mill in Baghdad (Chinese prisoners from the Battle of Talas in 751 had taught the Caliphate papermaking). He was beheaded in 803, allegedly for an affair with the Caliph's sister Abbasa — but probably because the Caliph feared that his family, the Barmakids, were becoming too influential. (His family was executed along with him, supporting the latter theory).
In the Arabian Nights, he's a minor figure, generally a hero, but Sunni tradition, which thinks very highly of Harun al-Rashid, assumed that Ja'far must have been guilty of something if the great Caliph had him killed...
Western authors appear to have picked up on this in a big way, and Grand Vizier Jafar is one of the great stock villains — the most recognizable modern form of the "Moorish magician," a variety of Ethnic Magician. The Arabian Nights version is The Good Chancellor, but the Western version is a Trope Codifier for Evil Chancellor.
Note that Jafar did not appear in the Arabian Nights version of "Aladdin" — the story was set in China, and had two villains where the Disney version has one. The Grand Vizier is hostile to Aladdin at first, but then he has a point; the real villain is a magician from North Africa. (A Moorish magician in a Middle Eastern story set in China...)
See also Names to Run Away from Really Fast.
- The Thief of Bagdad (1940) is the first 20th century work in which Grand Vizier Jaffar (played by Conrad Veidt) is the villain. Oddly, however, the main character, Ahmad, is referred to as Harun al-Rashid's grandson. It's unclear whether this Jaffar is meant to be the original one or not however given the original's execution during Harun's reign it is unlikely.
- The Golden Blade — which has Harun al-Rashid fighting him.
- Sinbad the Sailor needs to fight "Jaffar" in Sinbad of the Seven Seas, a rather obscure 1989 film starring Lou Ferrigno.
- In the 2000 miniseries Arabian Nights, Sultan Shahryar's grand vizier is named Ja'Far; he is one of the good guys, and the father of the heroine Scheherazade. (Incidentally, one of the stories Scheherazade tells is about a ruler named Harun al-Rashid, who is portrayed as a capricious monster.)
- He appears as the main villain in Once Upon a Time in Wonderland, though while all the characters are meant to be based on their original story he is clearly based more on the character from Disney's Aladdin.
- Quest for Glory II has a certain Ja'afar, who works as grand vizier to the sultan Harun al-Rashid. There's no treachery or backstabbing between them, however. You also don't find out that the poet is the sultan until near the end, though if you know the Arabian Nights it's sort of easy to figure out that someone going around with a guy named Ja'afar and knowing everything that goes on in the city just might be Harun al-Rashid.
- The Big Bad of Prince of Persia is a vizier named "Jaffar"[sic] who wants to marry the Sultan's daughter. For relevance reasons, we'll just stop there.