It Became a Buddhist Temple by the End of the 12th Century