Kusunoki Masashige's successful defense of Chihaya castle is believed to have helped the emperor gain power against the Kamakura bakufu. Kusunoki held out so long in his castle, so Ashikaga Takauji changed sides and helped the emperor. The Kamakura bakufu ended. However, Ashikaga Takauji quickly learned that he did not like following the emperor's commands. He changed loyalty again and established his own Ashikaga bakufu. He was able to establish his own shogunate after defeating Kusunoki Masashige and the commander in chief Yoshisada in the final battle. Kusunoki Masashige tried to bring Ashikaga Takauji back to the emperor's side, but the emperor rejected this plan.