Korçë's foundation is closely related with the actions of Ilias Bey Mirahori, a Muslim Albanian convert born in the village of Panarit in the Korçë area, who acquired large properties in the location of present-day Korçë. Ilias Bey was the 'Master of the Stables' of Sultan Bayezid II, and the first equerry and conqueror of Psamathia in the Ottoman capture of Constantinople. In 1484 Ilias Bey received, as a reward from the Sultan, seven villages located in the Korçë area: Leshnja, Vithkuq, Peshkëpi, Boboshtica, Panariti, Treska, and Trebicka. This accord was finalized gradually through four firmans. In the first firman Leshja and Vithkuq were accorded to Ilias Bey as mülk (land tenure). However he met difficulties while collecting the incomes and after twelve years these villages turned into their earlier status of timars, being substituted through a second firman in the year 1497 by the locality "Piskopiye", which included two sections. In the third firman (1497) the boundaries of Piskopiye were defined, establishing its demarcation between Mborje, Barç and Bulgarec, a site area corresponding to the territory of today's Korçë city. As a product of this process, the town of Korçë dates from the end of the 15th century.