Codomannus took the regnal name Darius III, and quickly demonstrated his independence from his assassin benefactor. Bagoas then tried to poison Darius as well, but Darius was warned and forced Bagoas to drink the poison himself. The new king found himself in control of an unstable empire, large portions of which were governed by jealous and unreliable satraps and inhabited by disaffected and rebellious subjects, such as Khabash in Egypt.
In 336 BCE Philip II of Macedonia was authorized by the League of Corinth as its Hegemon to initiate a sacred war of vengeance against the Persians for desecrating and burning the Athenian temples during the Second Persian War. He sent an advance force into Asia Minor under the command of his generals Parmenion and Attalus to "liberate" the Greeks living under Persian control. After they took the Greek cities of Asia from Troy to the Maiandros river, Philip was assassinated and his campaign was suspended while his heir consolidated his control of Macedonia and Greece.
In the spring of 334 BC Philip's heir, Alexander the Great, who had himself been confirmed as Hegemon by the League of Corinth, invaded Asia Minor at the head of a combined Macedonian army and almost immediately faced and defeated a Persian force at the Battle of the Granicus. In 333 BC Darius himself took the field against the Macedonian king, but his much larger army was outflanked and defeated at the Battle of Issus and Darius was forced to flee, leaving behind his chariot, his camp, and his family, all of which were captured by Alexander. In 331 BC, Darius' sister-wife Statira, who had otherwise been well-treated, died in captivity, reputedly during childbirth. In September of that year, after rejecting Darius' peace overtures, Alexander again defeated Darius at the Battle of Gaugamela, when his chariot driver was killed and Darius was knocked off his feet, which set off a general Persian rout, as his troops panicked at what they believed was the death of their king. Darius then fled to Ecbatana to begin raising a third army, while Alexander took possession of Babylon, Susa and the Persian capital at Persepolis.
Darius was deposed by his satrap Bessus and was assassinated at Bessus' order in July 330 BC, in order to slow Alexander's pursuit, and reportedly against Alexander's express wish that Darius be caught alive. Bessus left Darius' body in the road for Alexander to later see. Bessus took the regal name Artaxerxes V. Alexander gave Darius a magnificent funeral and eventually married Darius' daughter Statira at Opis in 324 BC. According to the historian Plutarch, Alexander also took on one of Darius' catamites, the eunuch Bagoas.