In 13th century Brahmaputra valley the system of Baro-Bhuyan "Raj" (confederacy) was formed from the petty chieftains—the remaining fragments of the erstwhile Kamarupa state. They often resisted foreign invasions (Ghiyasuddin Iwaj Shah in the 13th century), removed foreign rule (Hussain Shah in the 16th century) and sometimes usurped state power (Arimatta in the 14th century). They occupied the region west of the Kachari kingdom in the south bank of the Brahmaputra river, and west of the Chutiya kingdom in the north bank. These included areas of Nagaon, Darrang and Sonitpur districts. Subsequently, the Baro Bhuyan rules ended in the 16th century as they were squeezed between the Kachari kingdom and the Kamata kingdom in the west and were slowly overpowered by the expanding Ahom kingdom in the east.