The city eventually fell to the Byzantine Empire in 1018, following the Byzantine conquest of Bulgaria. Sredets joined the uprising of Peter Delyan in 1040–1041 in a failed attempt to restore Bulgarian independence and was the last stronghold of the rebels, led by the local commander Botko. It was once again incorporated into the restored Bulgarian Empire in 1194 at the time of Emperor Ivan Asen I and became a major administrative and cultural centre. Several of the city's governors were members of the Bulgarian imperial family and held the title of ''sebastokrator'', the second highest at the time, after the tsar. Some known holders of the title were Kaloyan, Peter and their relative Aleksandar Asen (d. after 1232), a son of Ivan Asen I of Bulgaria (). In the 13th and 14th centuries Sredets was an important spiritual and literary hub with a cluster of 14 monasteries in its vicinity, that were eventually destroyed by the Ottomans. The city produced multicolored sgraffito ceramics, jewelry and ironware. In 1385, Sredets was seized by the Ottoman Empire in the course of the Bulgarian-Ottoman Wars by Lala Şahin Pasha, following a three-month siege. The Ottoman commander left the following description of the city garrison: "Inside the fortress Sofia there is a large and elite army, its soldiers are heavily built, moustached and look war-hardened, but are used to consume wine and rakia—in a word, jolly fellows."