The expense of resources during the Roman–Persian Wars ultimately proved catastrophic for both empires. The prolonged and escalating warfare of the 6th and 7th centuries left them exhausted and vulnerable in the face of the sudden emergence and expansion of the Caliphate, whose forces invaded both empires only a few years after the end of the last Roman–Persian war. Benefiting from their weakened condition, the Arab Muslim armies swiftly conquered the entire Sasanian Empire, and deprived the Eastern Roman Empire of its territories in the Levant, the Caucasus, Egypt, and the rest of North Africa. Over the following centuries, more of the Eastern Roman Empire came under Muslim rule.