By 1517, the Ottomans had succeeded in conquering Medri Bahri. They occupied all of northeastern present-day Eritrea for the next two decades, an area which stretched from Massawa to Swakin in Sudan. The territory became an Ottoman governorate, known as the Habesh Eyalet. Massawa served as the new province's first capital. When the city became of secondary economical importance, the administrative capital was soon moved across the Red Sea to Jeddah.