Constant raids turned the city into a haven for refugees.The earthquake of 620 AD was only one reason for the city decreasing in size and becoming partially farmland.It is indicative of this state of affairs that in the 7th century the church of Hagia Sophia was three times smaller than the basilica that had existed on the same spot before.By the 9th century the city had again become a force in finance and trade, it also became a centre of missionary activity.In the beginnings of the following century Thessaloniki was besieged by Saracens.This however did not stand in the way of the city becoming a military station and a place of transit for trade.