Founded in the 11th century by the Almoravids as a military settlement, Meknes became a capital under Sultan Moulay Ismaïl (1672–1727), the founder of the Alawite dynasty. The sultan turned it into an impressive city in Spanish-Moorish style, surrounded by high walls with great doors, where the harmonious blending of the Islamic and European styles of the 17th century Maghreb are still evident today. Meknes is known for its imperial past, with remnants including Bab Mansour, a huge gate with arches and mosaic tiling. The gate leads into the former imperial city. To the south, ruined Heri es-Souani is a vast structure once used as stables and for food storage.

FRIGHTENING FACTS ABOUT SULTAN MOULAY ISMAIL IBN SHARIF: The most gruesome character in the history of Morocco, country’s own Vlad the Impaler has some dubious claims to fame — including fathering more kids than anyone else in history. Sultan Moulay Ismail Ibn Sharif was propelled to the throne of Morocco in 1672. His brother had been riding horseback after a victory banquet and was killed when his horse galloped beneath the low-hanging branches of the palace orchard.

Ismail’s reign as sultan, from 1672-1727, was longer than any other ruler in Moroccan history. Whether he should be remembered more for his beautiful creations or his cruel tyranny is a matter of dispute — but everyone agrees that Ismail was one of the most important rulers in Moroccan history.

Ismail was not, by any accounts, a very nice man. In fact, he’s been quoted as having said, “My subjects are like rats in a basket, and if I do not keep shaking the basket, they will gnaw their way through.”

It’s estimated that 30,000 poor souls met their deaths at the hands of the sultan — often for no reason. He was well known to kill people during fits of rage. According to one story, the sultan lopped off the head of a slave who had been adjusting his stirrup as he was mounting his horse. They didn’t call him “the Bloodthirsty” for nothing.

Ismail was well-known for siring hundreds of children. According to the Guinness Book of World Records, he fathered 888 children — the highest number of offspring for anyone throughout history that can be verified.

He was fiercely protective of his four wives and 500 concubines. Whenever a tribe surrendered to Moulay Ismail, the leader was forced to offer his most beautiful daughter to the sultan as a gift.

The women were treated like Ismail’s favorite toys. Each concubine was granted a personal eunuch, a castrated male slave, and an odalisque, or female attendant.

The lake-like Bassin de l’Agdal in Meknès served as an emergency source of water in times of war and a pool for his concubines in times of peace.

Men who merely glanced at one of his wives or concubines were punished by death. It’s said that men who encountered the sultan’s women laid facing the ground, so as to avoid any accusation of having looked upon them.

If any of Ismail’s harem were suspected of adultery, they were severely punished or put to death. The women were either strangled by the sultan himself or had their breasts cut off or teeth extracted.

Ismail succeeded the throne at the age of 26 and established Meknès as the capital of the kingdom. He was a member of the Sharif dynasty, which claimed to be descendants of the Prophet Mohammed, the founder of Islam.

Ismail used this pretense to justify his actions, both cruel and kind. His subjects bowed in his presence, and were not allowed to look him in the eye.

During his 55-year reign, he managed to create magnificent and enormous construction projects. His palace was built exclusively by European slaves, aided by bands of local criminals. The palace was four miles in circumference, and its walls were 25 feet thick.

As soon as he finished one project, he’d start on another. If he didn’t like something, he would order it demolished and a new one rebuilt.

Ismail’s favorite wife and queen of the palace was a black woman who started out as a concubine. Her name was Lalla Aisha Mubarka, or Zaydana, the name she acquired after giving birth to the sultan’s first son, Zaydan.

She held sway over Ismail and hatched a scheme to depose his favorite son, Mohammed al-Alim, suggesting that he intended to proclaim himself the sultan of Morocco. For his punishment, Ismail had his son’s left arm and right leg amputated for supposedly having rebelled against him. This was intended to send a message that any disobedience would mean severe punishment or death. Not surprisingly, Al-Alim died from blood loss.

The formidable Black Guard was comprised of slave warriors acquired from sub-Saharan Africa. Considered loyal, as they no longer had any tribal affiliation, the Black Guard were Ismail’s personal guards and servants.

By the end of his reign, he had raised a powerful army of more than 150,000 men. These men had families and lived in communities of their own, but essentially belonged to Ismail. The boys were raised to serve in his army, which helped Ismail maintain his position and conquer the whole of Morocco from European kingdoms. The girls would marry, have children and continue the cycle.

The Black Guard exists to this day, though its name was changed to the Moroccan Royal Guard after the country gained its independence in 1956.

The Habs Qara (Prison of Christian Slaves) was a large subterranean prison beneath the city of Meknès. At its height, it held an estimated 60,000 prisoners, 40,000 of them believed to have been Christian sailors captured at sea by Barbary pirates. The Christians were used as slave labor to build the city during the day and were shackled to the prison walls in the evening and forced to sleep standing up.

Rumors of the existence of secret tunnels leading from the royal palace to the prison persist, despite lack of evidence.