Between 639 and 641, Muslim Arabs conquered Egypt from the Byzantine Empire. Makuria, which by this time had been unified with Nobadia, fended off two subsequent Muslim invasions, one in 641/642 and another in 652. In the aftermath, Makuria and the Arabs agreed to sign the "Baqt", a peace treaty that included a yearly exchange of gifts and socioeconomic regulations between Arabs and Nubians. Alodia was explicitly mentioned in the treaty as not being affected by it. While the Arabs failed to conquer Nubia, they began to settle along the western coast of the Red Sea. They founded the port towns of Aydhab and Badi in the 7th century and Suakin, first mentioned in the 10th century. From the 9th century, they pushed further inland, settling among the Beja throughout the Eastern Desert. Arab influence would remain confined to the east of the Nile until the 14th century.