The Muslims pursued the retreating Byzantines, and laid siege to Alexandria. The siege dragged on for some time. The Byzantines within Alexandria became the victims of mutual dissension. Ibn Bassama a gate-keeper of one of the gates contacted the Muslims, and offered to open the gate to the Muslims, in case he was granted amnesty. 'Amr b Al 'Aas accepted the offer. One night the gate was opened, and the Muslim force rushed inside the city. In a hand to hand fight that followed the Byzantines were defeated, and the Muslims recaptured the city. On occupying the city, Amr b Al 'Aas had the walls of the city demolished to prevent the enemy from taking shelter within the city. The Copts who had remained loyal to the Muslims were duly compensated for the losses they had suffered because of the invasion of the Byzantines. After reorganizing the administration of Alexandria, 'Amr b Al 'Aas returned in triumph to Fustat.