In the closing days of the Kamakura period, a revolt by the people of Ezo had thrown the Kamakura bakufu into turmoil, and after the bakufu's collapse, the Ando clan had created flourishing strongholds out of thirteen ports, but eventually the Ando clan was brought to ruin by the rising fortunes of the Nanbu clan.
鎌倉時代末期には蝦夷の反乱が鎌倉幕府を揺るがし、幕府滅亡後には安東氏が十三湊を本拠地に栄えるが、やがて南部氏の興隆により没落する。