If The defenders retreated inside the walls of Palma, but on the last day of 1229 the city fell, and pockets of resistance throughout the island were also defeated., can we conclude that "Palma was defeated when its walls fell."?
yes