The crisis of the Third Century nearly destroyed the Roman Empire through instability of the position of emperor and various rebel breakaway empires. When Probus was murdered in 282 AD, Marcus Aurelius Carus was elevated by the military from his appointed position of prefect of the Praetorian Guard to Augustus, in turn naming his sons Carinus and Numerian as co-Caesari. Also during this time, Diocles rose through the ranks to become commander of the elite cavalry assigned to the Imperial household. Instead of going to Rome, Carus remained on campaign, leaving Carinus in charge of the western part of the empire from Gaul and taking Numerian with him to deal with the Persians. Along the way, Carus and Numerian took back areas lost previously over the years by defeating the Quadi and Sarmatians, and pressed on through Sassanian territory to regain Mesopotamia, Seleucia, and Ctesiphon. During the campaigns, Diocles was appointed consul. The army crossed the Tigris, but Carus died suddenly in July or August 283 for reasons unknown, leaving the empire split between the new co-Augusti, Numerian and Carinus.
Carinus left his post in Gaul for Rome to be declared emperor there in January 284. Historians describe his rule as cruel and despite only recognizing one wife, Magnia Urbica, it is said he was particularly adulterous and courted many of the wives of officers. Numerian finished campaigning in the East to complete an orderly withdrawal and start heading back to Rome. His entourage made it to Emesa in Syria by March, with Numerian apparently healthy, but it was reported his eyes were inflamed after he left the city and he traveled in a closed coach from then on. In November, they arrived in Bithynia, with the soldiers complaining the coach was odorous. They looked inside and found the emperor dead, declaring the cause as murder.
Aper, the father-in-law of Numerian and part of the entourage, released the news about the death when they arrived in Nicomedia and called a council. Aper tried to rally the generals and tribunes to support him, but they chose Diocles instead. Outside the city on November 20, the army gathered around a hill and unanimously proclaimed Diocles as emperor. He accepted the honor, raised his sword and denounced his involvement in the murder of Numerian, accusing Aper of the act and hiding it. He then slew Aper with his sword, quoting Virgil while doing so, according to the Historia Augusta. Soon after, Diocles changed his name to Diocletian, in an effort to hide that he came from a lowly family in Dalmatia.
Diocletian and Carinus were not the only ones claiming to be the leader of the Roman Empire. Marcus Aurelius Julianus (Julian of Pannonia) usurped northern Italy and Pannonia after the death of Carus or Numerian while Diocletian and his troops were on the move to Italy. Carinus marched on Julianus and defeated him in early 285 in Italy, on the way to confront Diocletian.
In July of 285, the armies of Diocletian and Carinus met at the Battle of the Margus River in Moesia, modern-day Serbia. Carinus had the advantage of a larger army, but Diocletian had more loyal troops. Details of the battle are not entirely known, but at some point during the course of it, historians say that Aristobulus, the Praetorian Prefect in the camp of Carinus, defected to Diocletian as a result of Carinus courting his wife. The emperor was killed during the battle, possibly by Aristobulus himself. Diocletian rewarded Aristobulus by naming him consul and Praetorian Prefect for the remainder of 285. With his victory, the Senate proclaimed a damnatio memoriae against Carinus and Diocletian decame the sole ruler of the Roman Empire – but only briefly. Diocletian knew the Empire was far too massive for one person to manage effectively and soon after created the Tetrarchy – a system of government with two Augusti and two Caesari.