During the Muromachi period, many clans fought over this area because there was a lot of silver. The Kyogoku clan controlled Izumo and Oki. However, after the Ōnin War, the Amago clan in Gassan-Toda castle increased in power, and the Masuda clan controlled Iwami. Iwami Ginzan Silver Mine was in between Amago clan territory and Masuda clan territory, so there were many battles between these lords for the large amount of silver. However, in 1566 Mouri Motonari (毛利元就) conquered Izumo, Iwami, and Oki. After over 30 years of Mori control, in 1600 Horio Yoshiharu entered Izumo and Oki after the Battle of Sekigahara which Mouri lost. Horio Yoshiharu decided to move and build Matsue Castle instead of Gassan-Toda. The castle was completed soon after Yoshiharu's death. Later in 1638, the grandson of Tokugawa Ieyasu, Matsudaira Naomasa entered the castle because the Horio clan had no heir. Matsudaira's family ruled until the end of the han system. 