An agreement called the Baqt, shaped Egyptian-Nubian relations for six centuries, and permitted the construction of a mosque in the Nubian capital of Dongola for Muslim travelers. By the middle of the 14th century, Nubia had been converted to Islam. The royal Church of Dongola was converted into a mosque.