Shahrbaraz is first mentioned when Khosrow II started the last and most devastating of the Byzantine–Sasanian wars, which lasted 26 years. Khosrow II, along with Shahrbaraz and his other best generals, conquered Dara and Edessa in 604, and in the north, the Byzantines were driven back to the old, pre-591 frontier before Khosrow II gave them most of Sasanian Armenia, parts of Mesopotamia and western half of the Kingdom of Iberia. After reconquering lost territory, Khosrow II withdrew from the battlefield and handed military operations to his best generals. Shahrbaraz was one of them. In 610, Heraclius, an Armenian of probable Arsacid descent, revolted against the Byzantine Emperor Phocas and killed him, crowning himself as Emperor of the Byzantine Empire. After becoming Byzantine Emperor, he prepared a major counter-attack against the Sasanians outside Antioch in 613, but was decisively defeated by Shahrbaraz, who inflicted heavy losses on the Byzantine army and then captured the city, giving the Sasanians naval access to the Mediterranean Sea.