Flavius Theodosius was born in Cauca, Gallaecia, Hispania (according to Hydatius and Zosimus) or in Italica, Baetica, Hispania (according to Themistius, Claudius Claudianus, or Marcellinus Comes), to a senior military officer, Theodosius the Elder. Theodosius learned his military lessons by campaigning with his father's staff in Britannia where he went to help quell the Great Conspiracy in 368.
In about 373, he became governor of Upper Moesia and oversaw hostilities against the Sarmatians and thereafter against the Alemanni. He was military commander (dux) of Moesia, a Roman province on the lower Danube, in 374, when the empire faced a formidable eruption of the Quadi and Sarmatians, the neighboring province of Illyricum being in fact briefly overrun. Theodosius is reported to have defended his province with marked ability and success. However, shortly thereafter, and at about the same time as the sudden disgrace and execution of his father, Theodosius retired to Hispania. The reason for his retirement, and the relationship (if any) between it and his father's death is uncertain, though probable.
The death of Valentinian I in 375 created political pandemonium. Fearing further persecution on account of his family ties, Theodosius abruptly retired to his family estates in the province of Gallaecia (present day Galicia, Spain and northern Portugal) where he adopted the life of a provincial aristocrat.
From 364 to 375, the Roman Empire was governed by two co-emperors, the brothers Valentinian I and Valens; when Valentinian died in 375, his sons, Valentinian II and Gratian, succeeded him as rulers of the Western Roman Empire. In 378, after the disastrous Battle of Adrianople where Valens was killed, Gratian invited Theodosius to take command of the Illyrian army. As Valens had no successor, Gratian's appointment of Theodosius amounted to a de facto invitation for Theodosius to become co-Augustus of the eastern half of the Empire. After Gratian was killed in a rebellion in 383, Theodosius appointed his own elder son, Arcadius, to be his co-ruler in the East. After the death in 392 of Valentinian II, whom Theodosius had supported against a variety of usurpations, Theodosius ruled as sole Emperor, appointing his younger son Honorius Augustus as his co-ruler of the West (Milan, on 23 January 393) and by defeating the usurper Eugenius on 6 September 394, at the Battle of the Frigidus (Vipava river, modern Slovenia) he restored peace.