Syria, including Seleucia Pieria, the port of Antioch. The Ptolemaic kingdom was at the height of its power. Fourth Syrian War (219–217 BC) Upon taking the Seleucid throne in 223 BC, Antiochus III the Great (241–187 BC) set himself the task of restoring the lost imperial possessions of Seleucus I Nicator, which extended from Greco-Bactrian Kingdom in the east, the Hellespont in the north, and Syria in the south. By 221 BC, he had re-established Seleucid control over Media and Persia, which had been in rebellion. The ambitious king turned his eyes toward Syria and Egypt. Egypt had been significantly weakened by court intrigue and public unrest. The rule of the newly inaugurated Ptolemy IV Philopator (reigned 221–204 BC) began with the murder of queen-mother Berenice II. The young king quickly fell under the absolute influence of imperial courtiers. His ministers used their absolute power in their own self-interest, to the people's great chagrin. Antiochus sought to take advantage of this chaotic situation. After an invasion in 221 BC failed to launch, he finally began the Fourth Syrian War in 219 BC. He recaptured Seleucia Pieria as well as cities in Phoenicia, amongst them Tyre. Rather than promptly invading Egypt, Antiochus waited in Phoenicia for over a year, consolidating his new territories and listening to diplomatic proposals from the Ptolemaic kingdom. Meanwhile, Ptolemy's minister Sosibius began recruiting and training an army. He recruited not only from the local Greek population, as Hellenistic armies generally were, but also from the native Egyptians, enrolling at least thirty thousand natives as phalangites. This innovation paid off, but it would eventually have dire consequences for Ptolemaic stability. In the summer of 217 BC, Ptolemy engaged and defeated the long-delayed Antiochus in the Battle of Raphia, the largest battle since the Battle of Ipsus over eighty years earlier. Ptolemy's victory preserved his control over Coele-Syria, and the weak king declined to advance further into Antiochus' empire, even to retake Seleucia Pieria. The Ptolemaic kingdom would continue to weaken over the following years, suffering from economic problems and rebellion. Nationalist sentiment had developed among the native Egyptians who had fought at Raphia. Confident and well-trained, they broke from Ptolemy in what is known as the Egyptian Revolt, establishing their own kingdom in Upper Egypt which the Ptolemies finally reconquered around 185 BC. Fifth Syrian War (202–195 BC) The death of Ptolemy IV in 204 BC was