During the Muromachi period (1336–1573), the Japanese created a settlement at the south of the Oshima Peninsula, with a series of fortified residences such as that of Shinoridate. As more people moved to the settlement to avoid battles, disputes arose between the Japanese and the Ainu. The disputes eventually developed into war. Takeda Nobuhiro killed the Ainu leader, Koshamain, and defeated the opposition in 1457. Nobuhiro's descendants became the rulers of the Matsumae-han, which was granted exclusive trading rights with the Ainu in the Azuchi-Momoyama and Edo periods (1568–1868). The Matsumae family's economy relied upon trade with the Ainu. They held authority over the south of Ezochi until the end of the Edo period.