Shahrbaraz belonged to the House of Mihran, a leading Iranian noble family, one of the Seven Great Houses of the Sassanid Persian Empire which claimed descent from the earlier Arsacid dynasty. He joined the Sasanian army, where he rose to high offices, and was appointed as spahbed (general) of Nēmrōz. He was even married to the sister of the Sasanian king Khosrow II, Mirhran.
Shahrbaraz is first mentioned by chroniclers when Khosrow II started the last and most devastating of the Byzantine–Sasanian wars, which would last 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, losing many of their territories. After this, Khosrow II withdrew from the battlefield and handed military operations to his best generals. Shahrbaraz was one of them. In 610, Heraclius, 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.
After the Byzantine defeat outside Antioch, Heraclius and his brother Theodore, along with General Nicetas, combined their armies in Syria, but were defeated by Shahrbaraz and his forces, who besieged Damascus and captured it along with a large number of Byzantine troops as prisoners. Furthermore, Shahrbaraz also defeated a Byzantine army near Adhqri’at, which is mentioned in the Quran. One of most important events during his career was when he led the Sasanian army towards Palestine, and after a bloody siege captured Jerusalem, a city sacred to the Christians. After his conquest of Jerusalem the Holy Cross was carried away in triumph. In 618, Shahrbaraz was ordered by Khosrow II to invade Egypt, and by 619, Alexandria, the capital of Byzantine Egypt, was in Sasanian hands.
In 622, Heraclius counter-attacked against the Sasanian Empire in Anatolia. Shahrbaraz was sent over there to deal with him, but was eventually defeated.
In 626 Shahrbaraz, commanded part of the army in charge of the siege of Constantinople. Disappointed by Shahrbaraz’s failure, Khosrow II ordered to kill Shahrbaraz and take his army back to Ctesiphon, but the bearers of the letter with the orders were intercepted in Galatia by Byzantine soldiers. After reading the letter, Heraclius offered to show it to Shahrbaraz in a meeting at Constantinople. Shahrbaraz then switched over to Heraclius’ side.
In 628, the feudal families of the Sasanian Empire, who were tired of war against the Byzantines and Khosrow’s oppressive policies, freed Khosrow’s son Sheroe, who had been imprisoned by his own father. In February, Sheroe, captured Ctesiphon and imprisoned Khosrow II. Sheroe then proclaimed himself as king of the Sasanian Empire on 25 February, assuming the regnal name of Kavad II. Three days later he ordered to execute his father. With the agreement of the nobles of the Sasanian Empire, Kavad II then made peace with the Byzantine emperor Heraclius who regained all lost territories, captured soldiers, a war indemnity and the True Cross and other relics that were lost in Jerusalem in 614.
Following the loss of territory required for the peace treaty, the embittered aristocracy started forming independent states within the Sasanian Empire. This divided the resources of the country. Furthermore, dams and canals became derelict, and a devastating plague erupted in the western provinces of Iran, killing half of the population along with Kavad II, who was succeeded by Ardashir III.
After the death of Kavad II, Heraclius sent Shahrbaraz a letter saying:
Now that the Iranian king is dead, the throne and the kingdom has come to you. I bestow it on you, and on your offspring after you. If an army is necessary, I shall send to your assistance as many [troops] as you may need.
On 27 April 630 Shahrbaraz besieged Ctesiphon with a force of 6,000 men. He finally captured Ctesiphon, and executed Ardashir III along with many Sasanian nobles. Shahrbaraz then became the new shah (king) of the Sasanian Empire.
Heraclius also acknowledged Shahrbaraz’s Christian son Niketas, as his heir. An Iranian Christian as the heir of the Sasanian Empire opened the chances of the Christianization of Iran. Forty days later, 9 June 630, during a ceremony, Shahrbaraz was killed by a javelin, and Boran, the daughter of Khosrow II, took the throne.
Shahrbaraz had played an important role in the Byzantine–Sasanian War, and the events that occurred after the war; his mutiny against Khosrow II caused the Sasanian Empire to fall into a civil war. After the death of Shahrbaraz, his son Shapur-i Shahrvaraz deposed Boran and became king of the Sasanian Empire. His reign, however, did not last long, and he was shortly deposed by the Sasanian nobles.