Ajvaz-dedo was a Sufi dervish who arrived in Akhisar (known today as Prusac, Bosnia and Herzegovina) with the conquering Ottoman armies in 1463.
The story of the rock dividing dates back to the legend of Ajvaz-dedo, an elderly man who prayed for water during a long period of drought that threatened the small mountain hamlet of Prusac in 1510, during Ottoman rule. However, Ajvaz Dede found a powerful spring of water near the village on the mountain Šuljaga. The spring had been shut off by a rock 74 meters long and 30 meters wide, which obstructed the construction of a running water system. Ajvaz-dedo spent 40 days beseeching Allah to split the rock. On the fortieth morning, following his prayers, Ajvaz Dede dreamt that two white rams collided and split the rock. When he awoke, he saw the rock split in half. Wooden pipes were placed along the newly formed canyon to take water into Prusac. Seeing it as a sign of God's miracle and blessing, people began going on pilgrimages to the place where the rock had split.