Until about 100 years ago the Medina Sidonia, or Melilla la Vieja, was all there was of the city. The city walls were vital to security, and their good condition today is easily explained with the many tribal chiefs and warlords in the surrounding areas up until the 1920's.
Most of the houses were restored in the 1990's, and the area is clean and proper, and quite attractive. But it is so small one wonders how this could have been all of the city once. Imagine perhaps 1,000 Spaniards living in a fortress hundreds of kilometres of sea away from the nearest Spanish settlement.