The temple owes its existence to a vow that Prince Shotoku Taishi made in 587 when he was just fifteen years old. The prince was known for his profound Buddhist faith when Buddhism was not widespread in Japan. The prince, under the reign of his aunt Empress Suiko, went to a war along with his father-in-law, Soga no Umako, the most powerful head of Soga clan. They fought against a rival clan named Mononobe who were opposed to the introduction of Buddhism in Japan. During the war, the huge army of opponents struck fear into soldiers and generals of the army on the side of the prince. The prince prayed for help to Shitenno (four Buddhist heavenly guardian kings) and promised them to build and establish a temple in their honor if they helped him to defeat the enemies. Freshly motivated, the army of the prince fiercely attacked the enemy and became victorious. So when the war was over and peace had returned, in 593 the prince started building a temple for the four heavenly kings in Settsu province, present-day Osaka.