The Arabs, now firmly in control of Syria and the Levant, sent frequent raiding parties deep into Asia Minor, and in 674–678 laid siege to Constantinople itself. The Arab fleet was finally repulsed through the use of Greek fire, and a thirty-years' truce was signed between the Empire and the Umayyad Caliphate. However, the Anatolian raids continued unabated, and accelerated the demise of classical urban culture, with the inhabitants of many cities either refortifying much smaller areas within the old city walls, or relocating entirely to nearby fortresses. Constantinople itself dropped substantially in size, from 500,000 inhabitants to just 40,000–70,000, and, like other urban centers, it was partly ruralised. The city also lost the free grain shipments in 618, after Egypt fell first to the Persians and then to the Arabs, and public wheat distribution ceased. The void left by the disappearance of the old semi-autonomous civic institutions was filled by the theme system, which entailed the division of Asia Minor into "provinces" occupied by distinct armies which assumed civil authority and answered directly to the imperial administration. This system may have had its roots in certain "ad hoc" measures taken by Heraclius, but over the course of the 7th century it developed into an entirely new system of imperial governance.