Magoksa is a head temple of the Jogye Order of Korean Buddhism in Gongju, South Korea. It is located on the eastern slope of Taehwasan, on taegeuk-shaped bend in the Taegeukcheon Stream. Magoksa is believed to have been established in 640 or 642 by the monk Jajang of Silla, however, this account is in dispute by some since Gongju would have lain within Baekje territory at that time.
Whenever it was actually built, it was certainly operational during the Baekje Dynasty and the temple has lasted since that time to the present day, as evidenced by it containing manuscripts made with liquid gold and silver - relics from the late Goryeo period. The temple, used as a place of refuge during the early Joseon Dynasty, was left largely untouched by the Seven Year War of the 1590s. It continued to play this role in the 20th century, when used as a hideout by Korean independence leader Kim Ku, who is also known to have planted the Chinese junipers seen here.