succeeded by different dynasties like the Qahtani, Hilwaani and eventually the Muzaffar dynasty and remained a powerful regional trading city-state, being the first to make use of the gold mines in Sofala. Eventually at the end of the 16th century the Muzaffarid dynasty allied themselves to the Somali Ajuran Empire For many years, Mogadishu stood as the pre-eminent city in the بلاد البربر, Bilad-al-Barbar ("Land of the Berbers"), which was the medieval Arab term for the Somali coast. Following his visit to the city, the 12th century Syrian historian Yaqut al-Hamawi wrote that it was inhabited by "Berbers", the ancestors of the modern Somalis. The conquest of Shoa ignited a rivalry for supremacy between the Christian Solomonids and the Muslim Ifatites, which resulted in several devastating wars and ultimately ended in a Solomonic victory over the Kingdom of Ifat. Parts of northwestern Somalia came under the rule of the Solomonids in medieval times, especially during the reign of Amda Seyon I (r. 1314–1344). In 1403 or 1415 (under Emperor Dawit I or Emperor Yeshaq I, respectively), measures were taken against the Muslim Sultanate of Adal. The Emperor eventually captured King Sa'ad ad-Din II of the Walashma dynasty in Zeila and had him executed. The Walashma Chronicle, however, records the date as 1415, which would make the Ethiopian victor Emperor Yeshaq I. After the war, the reigning king had his minstrels compose a song praising his victory, which contains the first written record of the word "Somali". Sa'ad ad-Din II's family was subsequently given safe haven at the court of the King of Yemen, where his sons regrouped and planned their revenge on the Solomonids. The oldest son Sabr ad-Din II built a new capital eastwards of Zeila known as Dakkar and began referring to himself as the King of Adal. He continued the war against the Solomonic Empire. Despite his army's smaller size, he was able to defeat the Solomonids at the battles of Serjan and Zikr Amhara and consequently pillaged the surrounding areas. Many similar battles were fought between the Adalites and the Solomonids with both sides achieving victory and suffering defeat but ultimately Sultan Sabr ad-Din II successfully managed to drive the Solomonic army out of Adal territory. He died a natural death and was succeeded by his brother Mansur ad-Din who invaded the capital and royal seat of the Solomonic Empire and drove Emperor Dawit II to