Sofia entered a period of economic and political decline in the 17th century, accelerated during the period of anarchy in the Ottoman Balkans of the late 18th and early 19th century, when local Ottoman warlords ravaged the countryside. Since the 18th century the ''beylerbeys'' of Rumelia often stayed in Bitola, which became the official capital of the province in 1826. Sofia remained the seat of a sanjak (district). By the 19th century the Bulgarian population had two schools and seven churches, contributing to the Bulgarian National Revival. In 1858 Nedelya Petkova created the first Bulgarian school for women in the city. In 1867 was inaugurated the first ''chitalishte'' in Sofia – a Bulgarian cultural institution. In 1870 the Bulgarian revolutionary Vasil Levski established a revolutionary committee in the city and in the neighbouring villages. Folling his capture in 1873, Vasil Levski was transferred and hanged in Sofia by the Ottomans.