In the Archaic Period, as in all other periods, most ancient Egyptians were farmers living in small villages, and agriculture. The Midle kingdom also built diplomatic and trade relations with Syria, Palestine and other countries; undertook building projects including military fortresses and mining quarries; and returned to pyramid-building in the tradition of the Old Kingdom. Around 1650 B.C., a line of foreign rulers known as the Hyksos took advantage of Egypt’s instability to take control. Conflict eventually flared between the two groups, and the Thebans launched a war against the Hyksos around 1570 B.C., driving them out of Egypt.