The empires of Egypt and Nubia interacted along the Nile River through both cultural exchange and military conflict over many centuries. Egypt expanded south during the Middle Kingdom and conquered parts of Nubia, but grew weaker over time and was invaded by Hyksos invaders. Under Thutmose III and later rulers, Egypt regained power and expanded further south into Nubia, dominating the Nubian kingdom of Kush. However, as Egypt declined, Kush emerged as a powerful kingdom and the Kushite king Piankhi was able to conquer Egypt. The interaction between the two civilizations resulted in the spread of culture between their peoples.