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.