Ja'far ibn Yahya al-Barmaki was Grand Vizier to Caliph Harun al-Rashid, 767-803 AD. He sponsored the academy which translated 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 having taught the Caliphate papermaking). He came from an Iranian family, and was in effect the head of the Persian/Iranian-style civil service which the Caliphate adopted to run their empire, making him a symbol of the continuity of Ancient Persia's culture in Islamic times. 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.
- A version of the character more in line with his depictions in the Arabian Nights appears as a minor supporting character in The Sandman comic Ramadan.
- An unusual version of Jafar appears in the Danish comic book Zainab, where he is the goofy, underachieving son of Yahya al-Barmaki, Harun al-Rashid's Grand Vizier (who is much closer to the traditional Jafar). The Caliph likes to keep him around as a kind of court jester, and marries him off to his favorite sister Abassah, so he can enjoy her unveiled beauty and Jafar's company simultaneously without violating Islamic law. He orders them to stay apart when he is not present, and that goes about as well as you would expect:
Grand Vizier Yahya: You big nincompoop! Do you realize what you have done? You have grossly abused the Caliph's trust with your nightly trysts with Princess Abassah! You are a disgrace to our House ...Jafar: Yes, Father ...Grand Vizier Yahya: ...and now she's pregnant! Did you know that??Jafar: What? Surely not very much.Grand Vizier Yahya: HAHAHRRRAAANGGG! I'LL KILL YOU, YOU SON OF A DOG!!!
- 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.
- Twisted: Ja'far is the Only Sane Man in the Magic Kingdom, an overworked bureaucrat who has to deal with an insane Sultan as his boss, a resentful Captain of the Guard bringing up his failures at every opportunity, the populace hating his guts and blaming him for all the kingdom's problems (including the sun going down at night). And then the Princess sets an apex predator on a visiting prince by way of rejecting his advances, starting a war that only ends after he becomes a genie.
- 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.
- Meanwhile, the Big Bad is an evil vizier named Ad Avis who is more inline with how the character is usually portrayed, hypnotizing the protagonist with eye based magic and forcing him into a cave to find a sealed genie. Oddly enough, the fourth game reveals that he’s also part vampire.
- 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.