For most parts of its long history, ancient Egypt was unified under one government. The main military concern for the nation was to keep enemies out. The arid plains and deserts surrounding Egypt were inhabited by nomadic tribes who occasionally tried to raid or settle in the fertile Nile River valley. Nevertheless, the great expanses of the desert formed a barrier that protected the river valley and was almost impossible for massive armies to cross. The Egyptians built fortresses and outposts along the borders east and west of the Nile Delta, in the Eastern Desert, and in Nubia to the south. Small garrisons could prevent minor incursions, but if a large force was detected a message was sent for the main army corps. Most Egyptian cities lacked city walls and other defenses.