The Samye Monastery or Samye Gompa is the first Buddhist monastery built in Tibet, constructed in approximately 775 AD under the patronage of King Trisong Detsen of Tibet who sought to revitalize Buddhism which had declined since its introduction by King Songtsen Gampo in the 7th century.
Tradition holds that the Indian monk Shantarakshita made the first attempt to construct the monastery while promoting his sutra-centric version of Buddhism. Finding the Samye site auspicious he set about to build a structure there. However the building would collapse after reaching a certain stage. Terrified, the construction workers believed that there was a demon in a nearby river making trouble.
However when Shantarakshita’s contemporary Guru Rinpoche arrived from Swat, the great guru was able to subdue the problematic Bön demons and thus build the monastery. This marked the foundation of the original school of Tibetan Buddhism, the Nyingma. This also helps explain how Guru Rinpoche’s tantric-centric version of Buddhism gained ascendence over the sutra-based teaching of Shantarakshita.