In 19 H (640 CE) the forces of the second Islamic Caliph, 'Umar overran the key cities of Mesopotamia, forcing the Sassanid emperor, Yazdegird III, to withdraw across the Zagros Mountains to the Iranian heartland. He set up a new headquarters at Ray, called for aid from his nobles, and counter-attacked, but without much success. About 21 H (642 CE) the Caliph's forces began a new phase of their attacks by seizing a key pass over the mountains in the battle of Nihawand (now Nahavand). A Muslim army, led by Nu'aim ibn Muqarrin, descended (about 22 H/ 643 CE) from the uplands to the central plain of Iran. Yazdegird had moved on, leaving Ray in the hands of local governor Siyavakhsh, son of Mihran Bahram-i Chubin, son of Bahram Chobin. Allying himself with his neighbours further east (in Damavand, Tabaristan etc.) on the grounds that if Ray fell, they would be next, Siyavakhsh put up a strong defence, but after about a week he was, according to al-Tabari, betrayed by one of the city's aristocrats, Farrukhzad (perhaps due to political rivalry, perhaps because he had led a force from Ray to help battle the invaders at Waj Rudh, on the road from Hamadan, and had seen at first-hand the consequences of resisting the Muslims). While the armies engaged in a night battle at the foot of the mountain just outside Ray, he led some of Nu'aim's cavalry by a little-known route into the city (an alternative version has the Muslims discovering the way into the city for themselves), from whence they emerged to attack the defenders' rear, causing great slaughter. To set an example, Nu'aim ordered the destruction of the Old Town (al-Atiqah, perhaps the aristocratic quarter of Ray; it was rebuilt by Farrukhzad, whom he appointed as governor). Damavand and other territories to the east swiftly capitulated.