Shahryār or Shahriār or Shahriyār or Schahryār (Persian: شهريار, meaning The Great King) was the Sassanid King of kings who ruled over a Persian Empire extending to India, over all the adjacent islands and a great way beyond the Ganges as far as China, while Shahryār’s younger brother, Shāhzamān (شاهزمان) ruled over Samarkand. The King Shahryār was a Sassanid, and thus a Zoroastrian and not a Muslim, which was the prevelent religion of that region.
When Shahryār was betrayed by one of his wives he became immensely suspicious of women, believing that they would all betray him in the end. For three years, the king would take a wife and have her executed the next morning, until he married Scheherazade, the daughter of his vizier. Scheherazade spent 1001 nights telling Shahryār various stories ending each night with a cliffhanger so that, in order to hear the end of the story, Shahryār would have to keep her alive.