Ibn Qudama al-Maqdisi, the “Shaykh al-Islam” of the Hanbali School, wrote in his book Those Who Repented:
It has been related that Malik ibn Dinar was asked about the cause of his turning back toward Allah. He said:
I was a policeman and I was given to drinking. A daughter was born to me and she completely took my heart. When she began to crawl on all fours I grew even more fond of her and we became strongly attached to each other. Whenever I put a strong drink in front of me she would come to me and pull it away from me, spilling it on my clothes. When she completed two years she died. I became consumed with grief over her loss.
When the Night of Mid-Sha’ban came — and it was the Eve of Friday — I stayed home out of inebriation and I did not pray the Isha prayer. Then I had a dream that the Day of Judgment had begun, the Trumpet was blown, the graves were opened, mankind was raised and gathered, and I was among them. I heard something behind me. I turned around and saw a serpent of indescribable size, blue-black, rushing for me with wide open jaws. I fled in terror.
I passed by a shaykh dressed in spotless clothes, exuding a fragrant smell. I greeted him and he greeted me back. I said to him: “O shaykh! Protect me from this serpent, may Allah protect you!” The shaykh wept and said: “I am weak and it is stronger than me, I cannot overcome it. Go quickly, perhaps Allah will grant you something that will save you from it.”
I turned and resumed my flight. I climbed up on a high place and found myself overlooking the different levels of the Hellfire. I looked at the horror they contained and almost fell in for fear of the serpent. However a voice cried out to me: “Go back! You are not among its people.” His words stilled my fears and I went back.
But the serpent again pursued me. I went back to the shaykh and said: “O shaykh! I begged you to protect me from this dragon but you didn’t protect me.| Again he wept and said: “I am weak, but proceed to this mountain. In it the deposits of Muslims are stored. If there is a deposit there for you, then it will help you.”
I looked and saw a round-shaped mountain of silver topped with domes of hollowed pearl and hanging drapes, and every dome had two large gates of red gold encrusted with emeralds and pearls and overhung with drapes of silk.
When I saw the mountain I fled to it with the serpent in hot pursuit. As I approached the mountain one of the angels cried: “Raise up the veils, open the gates, and come out! Perhaps this poor soul has something in store with you that will save him from his enemy.” At this the veils were lifted, the gates were opened, and out of the palaces came children with faces like full moons. The serpent was catching up to me and I was near despair.
One of the children cried: “Come on! All of you come out! His enemy is very near him!” Whereupon the children came one wave after another, and among them was the dear daughter of mine that had died. When she saw me she wept and said: “My father, by Allah!” Then she leaped on a ball of light like an arrow and landed in front of me. She put her left hand in my right hand and I held on to her. Then she stretched her right hand towards the serpent and it turned around and fled.
My daughter bade me sit, then she sat in my lap and began to stroke my beard and said: “O my father! Has not the time come for those who believe, that their hearts become humble at the remembrance of Allah? (57:16) I began to weep and said: “O my daughter, you children know the Qur’an?” She replied: “My father! We know it better than you.”
I said to her: “Tell me about the serpent which wanted to destroy me.” She said: “Those were your evil deeds which you built up and strengthened, and they wanted to take you to the Hellfire.” I asked: “What about the shaykh I passed by?” She replied: “O my father, those were your righteous deeds, you made them weak until they were no match for your evil deeds.”
I said: “O my daughter! What are you all doing in this mountain?” She said: “We are the children of Muslims, we have been given this dwelling place until the Hour rises. We await for you to join us and then we intercede for you.” Malik said: “Then I awoke up scared. I poured out the intoxicants and shattered the drinking-cups, and I repented to Allah (most great and majestic). That was the cause of my turn back to Him.
Source: Ibn Qudama al-Maqdisi, al-Tawwabeen, Beirut: Dar Ibn Hazm, 2003, pp. 124-6.
Also quoted by Shaykh Salim al-Sanhuri al-Maliki, the hadith master and Mufti of the Maliki school in his age, in his treatise: On the Virtues of the Night of Mid-Sha’ban (edited and published by Shaykh Salih al-Ja’fari in Cairo: Dar Jawami’ al-Kalim).