When Oda Nobunaga advanced into Yamato Province, Imai — a fortified temple town centered on Shonen-ji Temple, encircled by moats and earthworks — fiercely resisted him. Around 1575, a peace was reached, sparing the town further warfare and preserving its autonomy, which paved the way for its later fame as a wealthy commercial town.