It is reported by Ibn Khaldoun (but not other sources) that the Arabs of Palermo and the Berbers of Agrigento patched up their differences just in time to present a united Sicilian front to negotiate with the Aghlabids. Others report the two parties tried to negotiate separately with Abu al-Abbas Abdallah. In either case, the negotiations failed, and the Arabs of Palermo assembled an army, under the command of a certain Rakamuweih (an Arabized Persian) to march against the Aghlabid expeditionary force. Sicilians and Aghlabids clashed at the terrible Battle of Trapani, without a clear victor. The Sicilian Arabs retreated to Palermo, hoping to regroup and gather reinforcements there. Abu al-Abbas Abdallah gathered up his army and gave chase. In September 900, the Aghlabids caught up with and defeated the Sicilian army before Palermo. The Sicilian rebel remnant withdrew into the fortified citadel ("qasr") of Palermo (the old center now known as Cassaro), leaving the town and suburbs open to the sack of the Ifriqiyan army. After about a week, on 18 September 900, the Sicilian rebels surrendered, yielding up the Qasr to Abdallah in return for safe-passage of the rebel leaders into exile. Streams of Palerman refugees made their way east to take shelter in the Byzantine holdings.