 However, fierce resistance by the local population and soldiers resulted in the failure of the Portuguese to permanently occupy the city and eventually the Portuguese would be decisively defeated by the powerful Somalis from Ajuran Empire, and the inhabitants who had fled to the interior would eventually return and rebuild the city.Tristão da Cunha was later severely wounded and sought refuge in Socotra islands after losing his men and ships.After losing the war with the Ajuran Empire over the failed attempt to capture Barawa.