Mir Jumla II invaded the Ahom kingdom in January 1662 and left it in January–February 1663. He was able to occupy Garhgaon, the Ahom capital, before the beginning of the rainy season, but he and his army were confined mostly to Garhgaon and Madhupur during that period. The Ahom king Sutamla had to take flight and hide in Namrup during Mir Jumla's occupation of the capital. The defection of Baduli Phukan, a high ranking Ahom commander, precipitated the Treaty of Ghilajharighat in January 1663, with the Ahom king accepting tributary status. Mir Jumla died on his way back before he could reach Dhaka, his capital.