Heraclius beat Persia after nearly surrendering, then lost the prize to the Arabs
In 615, with a Persian army camped across the Bosporus, the Byzantine emperor Heraclius offered to become the Shah's obedient son. The Shah refused. A dozen years later Heraclius crushed the Persians at Nineveh and won the war outright, only to watch Arab armies take Syria, Egypt and Mesopotamia within his lifetime.
Born around 575, Heraclius was the son of Heraclius the Elder, the Exarch of Africa, whose roots are debated: several historians think him probably Armenian, while Anthony Kaldellis argues no primary source says so. In 608 father and son rebelled against the emperor Phocas, widely regarded as a usurping tyrant. A cousin, Nicetas, seized Egypt while the younger Heraclius sailed for Constantinople, where the elite Excubitor guard defected to him. He was crowned on 5 October 610.
He inherited a disaster. Persia's Khosrow II, once restored to his throne by the murdered emperor Maurice, had turned on the empire. Heraclius lost near Antioch in 613; Damascus fell that year and Jerusalem in 614, where the True Cross was carried off, and Egypt followed. By 618 he considered moving the capital to Carthage until Patriarch Sergius and the citizens persuaded him to stay. He slashed civilian spending and borrowed the Church's treasures, melted down, to rebuild the army.
On 4 April 622 he marched out, restoring discipline with drills and rallying troops behind an image of Christ said to be made without human hands. Years of campaigning in Armenia and the Caucasus followed. In 626 an Avar, Slav and Persian siege of Constantinople failed, and his brother Theodore beat a second Persian army. After victory at Nineveh in 627, Khosrow was overthrown by his own son Kavad II, who agreed to withdraw from every occupied territory.
The triumph left the empire exhausted. From 636, forces of the Rashidun Caliphate defeated Theodore in Syria and soon took Mesopotamia, Armenia and Egypt, though Heraclius's reforms helped his successors survive. He also tried to heal a church split with a compromise doctrine, monothelitism, which every side rejected, and under him Greek replaced Latin as the state's official language. His marriage to his niece Martina scandalised Byzantine society. He died on 11 February 641.
Source: Heraclius