The use of rock-cut sanctuaries goes back to the time of Emperor Ashoka, during the third century b.c. , when itinerant Buddhist monks formed a religious order and the emperor provided them with rock-hewn cells as a vihara (retreat) during the monsoons.
The emperor gave traveling Buddhist monks rooms carved out of rocks for shelter during the monsoons in the third century B.C.