The Emperor Tenmu, who was an enemy of Prince Otomo at Jinshin War, approved the restoration of this temple in 686 and named the temple 'Onjo-ji Temple' as jigo (literally, "temple name", which is the title given to a Buddhist temple).
壬申の乱で大友皇子と敵対していた天武天皇は、朱鳥元年（686年）この寺の建立を許可し、「園城寺」の寺号を与えた。