During the Second Intermediate Period, Minya with the rest of Lower and Middle Egypt fell under the control of the Hyksos. It appears that Minya's rulers actually supported the Hyksos 15th Dynasty rulers against the native Egyptian pharaohs of the 16th and 17th dynasties. Towards the end of the Second Intermediate Period when the Theban Pharaohs started their struggle to expel the Hyksos out of Egypt, Minya was the site where the first major battle of this conflict took place. In 1552 BC, Kamose, the last Pharaoh of the 17th dynasty marched his Medjay troops north to Nefrusy few miles to the south of Minya and there he defeated the army of a man called Teti son of Pepi, who is said to have transformed Minya into a "nest of the Asiatics". This was the first major defeat for the Hyksos which later would encourage Ahmose I, the younger brother of Kamose, to march north and expel the Hyksos out of Egypt for good around 1540 BC.