This is a Palestinian folktale retold by the amazing Margaret Read MacDonald. Check out her website, seriously she is an incredible storyteller/folklorist!
This story comes from a collection by Ibrahim Muhawi and Sharif Kanaana called Speak Bird, Speak Again: Palestinian Arab Folktales. Their whole book can be read online here. It contains stories for children and also some stories just for grownups.
The illustrations are so cool! They are by Alik Arzoumanian and here is a link to her instagram.