Grand Vizier Ja'far

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...)

Comic Books

 * 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.

Film

 * The Thief of Bagdad is the first 20th century work in which Grand Vizier Jafar is the villain. Oddly, however, the main character, Ahmad, is referred to as Harun al-Rashid's grandson. It's unclear whether Jaffar is meant to be the original one or not.
 * 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.

Video Games

 * 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.
 * Prince of Persia and Prince of Persia: The Sands Of Time.

Western Animation

 * Disney's Aladdin.