By the late Middle Ages, Buddhism had become virtually extinct in India, although it continued to exist in surrounding countries