In 1161-2 the Tanguts briefly occupied territory of both the Jurchen Jin dynasty and Song dynasty during the Jin–Song Wars.