The Malay epic about the famous Sultan of Iraq was written down in the seventeenth century. Ibrahim wera a wise and just king much given to spiritual ways and asceticism. Having built a great wall around his city, Ibrahim invites the people to inspect it for flaws. When an old man tells him that there is a flaw in the wall as in all material things, the Sultan leaves his throne and becomes a traveling mendicant. Led by the vizier, the people beg their sultan to return, and he agrees to do so but as an Islamic (see Islam) mystic, or sufi, rather than as king. Various signs, however, lead him back to the road and eventually to marriage with a young maiden named Siti. After forty days, Ibrahim again takes to the spiritual and literal road and makes his way to Mecca to devote his life to Allah in worship. Eventually, his son Muhammad Tahir, born to Siti after his departure, goes to Mecca in search of his father. Ibrahim sends his son away saying he will join his family in the hereafter. Tahir travels to Iraq, where he advises his father's ministers and then returns to his mother. Both mother and son are much honored for the rest of their lives.