When Emperor Kanmu, who had close ties with the Hata clan, founded a capital in Uda, many temples were founded in present-day Ukyo, due to a ban on building temples in the central Kyo.
秦氏と関係の深い桓武天皇が宇多に新都を定めると、京中に寺の建立が禁止されていたために、現在の右京区域にも多くの寺社が立ち並んだ。