The Principality of Muzaka (Albanian: Principata e Muzakajve) was a group of territories ruled by the Albanian Muzaka with its capital at Berat. One of the first rulers was Andrea I Muzaka whose reign was recognized by the Byzantine Emperor. During the Battle of Savra, the Ottomans captured Berat from Balša II, together with Kruja and Ulcinj. They soon retreated from all of those towns keeping only Castoria under their permanent control. Some sources explain that Ottomans probably remained in Berat with intention to use it as foothold to capture Valona. By 1396 Muzaka family took over control of Berat. In 1417 Berat became a part of the Ottoman Empire.