Old brass oil lamp oriental gin on a blurred background of different antiquitiesGetty

Audiences swooned over recent images of the new Jafar in Disney’s new live-action version of Aladdin, but the suddenly popular Disney villain is based on a real person, who was known more for his scientific interests than his sex appeal (well, mostly). Ja’far ibn Yahya, vizier to caliph Haroun el-Rashid, was one of the most powerful people in the Abbasid caliphate, the empire that ruled a broad swath of central Asia and northern Africa from 750 to 1258 CE, and he used his influence to promote science in the Arab world, contributing to the fluorishing of medicine, astronomy, and engineering in medieval Islamic society.

Ja’far didn’t rise to power out of nowhere. He had been born into a powerful family, the Barmakids, with deep roots in a region of Afghanistan once known for its Buddhist monasteries. The Barmakids had once been the leaders and administrators of two large monasteries in Balk, just north of Mazar-e Sharif, but various members of the family converted to Islam, at least officially, when Arab armies occupied the region starting around 651 CE. Well-educated and influential, the Barmakids found themselves near the center of power under the Abbasid caliphate; Ja’far’s father before him had served as vizier, and two of his brothers governed Egypt and Damascus.

And several members of the family became well known patrons of scientists and scholars. Because the family still maintained close connections with Buddhist communities in Iran and India (after all, their conversion was very recent, and some members of the Abbasid court occasionally questioned its sincerity), they frequently invited scholars from those places to the Abbasid court in Baghdad, spreading knowledge and innovations in medicine, astronomy, and other sciences further north and west. Ja’far actively continued that family tradition, but today he is best known for his role in introducing the art and science of papermaking to Baghdad.

Before 751 CE, papermaking was a closely-guarded state secret of the Chinese Empire. Chinese merchants sold small quantities, which turn up in archives across central Asia and the Middle East, but they refused to share the secret of its manufacture. But in 751, the Abbasid Caliphate and the Chinese Tang Dynasty found themselves at odds over control of territory in Central Asia, along a key trade corridor known as the Silk Road. The conflict culminated in the Battle of Talas in modern-day Kazakhstan, where the Abbasids and their allies from the Tibetan Empire emerged victories — and with several Chinese prisoners of war, who eventually spilled the secret of papermaking. Ja’far convinced the caliph to build a paper mill in Baghdad, which gave the caliphate a ready source of paper. That sounds like a minor thing today, but at the time, it was a major boost to communication, information, and scholarship — something like the effect the printing press would have centuries later.

The vizier Ja’far’s influence was so great that both he and his caliph, Haroun el-Rashid, appeared, mentioned by name, in several of the stories in the Arabian Nights. But unlike the version modern audiences know today, the earlist fictional versions of Ja’far were protagonists, not villains. He solved murder mysteries (under the threat of execution if he missed the deadline), went on adventures, and provided valuable knowledge and advice. He didn’t become a sorceror and a villain until centuries later, as the stories gradually evolved. And in many of those later stories, Ja’far also has a habit of trying to seduce or marry the princess — a plot point modern audiences probably recognize.

We can’t be sure whether the real Ja’far was as — so to speak — audience-friendly as the version in the new live-action Aladdin movie, but at least Princess Abbasa, the caliph’s sister, seems to have thought so; rumor has it that an affair with the princess led to Ja’far’s execution in 803 CE. But rumor is all we really have to go on; the historical records aren’t very clear, and Haroun el-Rashid had the entire Barmakid family executed in 803 CE, which is an extreme response to one man’s affair, even with a princess. Some historians say it’s much more likely that the Barmakids, with their enormous wealth and large private army, gradually became a threat to the caliph’s power — one he eventually dealt with in the most final manner available.

But their contributions to the spread of scientific knowledge, especially those of Ja’far ibn Yahya, had already been set in motion. The ideas and methods they helped import from India and elsewhere made the Middle East a center of scholarship throughout the Middle Ages, and those ideas eventually spread to Europe and helped spark the Renaissance. That’s pretty impressive for a guy who didn’t even have a talking parrot to help him out.