Shiva Purana
गर्तात्ततस्समुत्पन्नः शिवो विकटरूपधृक् ॥ महाकाल इति ख्यातो दुष्टहंता सतां गतिः ॥ ३७॥
From the chasm thus created, Śiva rose up assuming a hideous form. He became famous as Mahākāla, the slayer of the wicked and the goal of the good.
english translation
gartAttatassamutpannaH zivo vikaTarUpadhRk ॥ mahAkAla iti khyAto duSTahaMtA satAM gatiH ॥ 37॥
hk transliteration by Sanscript