linguistic:voice_change, structural:reformatting, information:highlighting
Final years and aftermath (1341–1392)

In winter 1341 Tatars, Ruthenians led by Detko, and Lithuanians led by Liubartas were able to defeat the Poles, although they were not so successful in summer 1341. Finally, Detko was forced to accept Polish overlordship, as a starost of Galicia. After Detko's death, Casimir III mounted a successful invasion, capturing and annexing Galicia in 1349.

The Romanovichi (branch of the Rurikid) dynasty of Daniel of Galicia attempted to gain support from Pope Benedict XII and broader European powers for an alliance against the Mongols, but ultimately proved unable to compete with the rising powers of the centralised Grand Duchy of Lithuania and the Kingdom of Poland. Only in 1349, after the occupation of Galicia–Volhynia by an allied Polish-Hungarian force, was Galicia–Volhynia finally conquered and incorporated into Poland. This ended the vassalage of Galicia–Volhynia to the Golden Horde.

From 1340 to 1392, the civil war in the region transitioned into a power struggle between Lithuania, Poland, and Hungary. The first stage of conflict led to the signing of a treaty in 1344 that secured the Principality of Peremyshl for the Crown of Poland, while the rest of the territory belonged to a member of the Gediminid dynasty of Liubartas. Eventually by the mid-14th century, the Kingdom of Poland and the Grand Duchy of Lithuania divided up the region between them: King Casimir III took Galicia and Western Volhynia, while the sister state of Eastern Volhynia together with Kiev came under Lithuanian control, 1352–66.

Following the death of Casimir the Great in 1370, Galicia–Volhynia was ruled by Vladislaus II of Opole in 1372–1379 and 1385–1387, as Lord of Ruthenia (Terre Russie Domin), being a descendant of princes of Belz and a subject of King Louis I of Hungary. Vladislaus strongly contributed to the establishment of Roman Catholic Archdiocese of Lviv as part of Polish Catholicisation.