The Pashalik of Yanina or Janina (1788–1822) was a subdivision of the Ottoman Empire centred on the region of Epirus and had a high degree of autonomy in the early 19th century under Ali Pasha, although it was never recognized as such by the Ottoman empire. Its core was the Ioannina Eyalet, centred on the city of Ioannina in southern Epirus, but at its peak it comprised most of Albania and the western portions of Thessaly and Greek Macedonia in Northern Greece.
In 1787 Ali Pasha was awarded the pashaluk of Trikala in reward for his support for the sultan's war against Austria. This was not enough to satisfy his ambitions; shortly afterwards, in 1788, he seized control of Ioánnina, which remained his power base for the next 33 years. Like other semi-autonomous regional leaders that emerged in that time, such as Osman Pazvantoğlu, he took advantage of a weak Ottoman government to expand his territory still further until he gained de facto control of most of Southern Albania, western Greece and the Peloponnese, either directly or through his sons.
The Ioannina Eyalet (Ottoman Turkish: ایالت یانیه; Eyālet-i Yānyâ) was an administrative unit of the Ottoman Empire located in the territory of present-day southern Albania, central and northern Greece. It was formed in 1670 and its administrative centre was Ioannina. In period 1788—1822 Ali Pasha, the sanjakbey of Trikala, seized control over Ioannina and after enlisting amost of the local brigands under his own banner took advantage of a weak Ottoman government to gain control over the Ioannina Eyalet and most of Albania and continental Greece, transforming it into the semi-autonomous Pashalik of Yanina. After he was killed in 1822 the Ottoman Empire reestablished the Ioannina Eyalet which existed until establishment of the Janina Vilayet in 1867.
Sanjaks of the Eyalet in the mid-19th century:
Wer Gutes tut dem wird vergeben
So seid recht gut auf allen Wegen
Dann bekommt ihr bald Besuch
wir kommen mit dem Liederbuch
Wir sind für die Musik geboren
Wir sind die Diener eurer Ohren
Immer wenn ihr traurig seid
spielen wir für euch
Wenn ihr ohne Sünde lebt
Einander brav das Händchen gebt
Wenn ihr nicht zur Sonne schielt
wird für euch ein Lied gespielt
Wir sind die Diener eurer Ohren
Wir sind für die Musik geboren
Immer wenn ihr traurig seid
spielen wir für euch
Wenn ihr nicht schlafen könnt
sei euch ein Lied vergönnt
Und der Himmel bricht
Ein Lied fällt weich vom Himmelslicht
Wir sind für die Musik geboren
Wir sind die Diener eurer Ohren
Immer wenn ihr traurig seid