It took twenty years of intermittent struggle to impose even partial Polish authority. The Lithuanians established themselves in the north. Casimir satisfied himself with acknowledgement of his suzerainty by Lithuanian princelings. Casimir held the south, centred on the town of I.’viv (Lwow/Lvov/Lemberg). But even here he owed his position to Hungarian support. Poland’s Rus’ lands remained separate from the rest of the Crown: in return for Louis of Hungary’s assistance in their subjugation, Casimir agreed in 1350 that they would pass to him on his demise. Divisions in Lithuania, where Duke Gediminas’ seven sons quarrelled among themselves after his death in 1341, worked to Casimir’s advantage. Even the Black Death helped: it left a sparsely populated Poland largely unscathed, but in 1346 it devastated the Golden Horde. Despite all this, the venture cost Casimir dear. In 1352, to raise money for his war effort, he plundered the archiepiscopal treasury in Gniezno. He borrowed from all and sundry, even from the Teutonic Knights, to whom he assigned the county of Dobrzyn as security. Impoverished Dobrzyn could scarcely begin to compare with Rus' potential prosperity.
Casimir’s principal achievement was to restore strong monarchic rule at home, within the narrow limits open to any medieval ruler. His deliberate patronage of talented lay and ecclesiastical advisers from southern Poland, the advancement of their careers by service on the royal council, created a generation of new men, ready to aid and abet fresh fiscal and administrative initiatives. The king was more aware than his predecessors of the value of more formal means of government. In 1364, he set up, in Krakow, a partial university or studinm generate, teaching mainly law, with some medicine and astronomy (the papacy would not agree to instruction in theology). The new institution above all aimed at producing the jurists and lawyers increasingly indispensable to the government of a self-respecting monarchy. Casimir introduced written regulation of judicial procedure and criminal law. In the i 360s, he began to widen the bases of his support to Wielkopolska. He never sought to put an end to the established divisions and differences between his two chief provinces, but instead played their elites off against each other. An extensive programme of revindication of usurped royal lands, often by arbitrary royal fiat, recovered hundreds of properties, though it led to revolt in Wielkopolska in 1352. Casimir made some tactical concessions. In 1360, after the troubles had died down, the revolt’s leader, Mačko Borkowic, was arrested, chained in a dungeon and starved to death, though it seems that his involvement with local brigandage rather than his political past was more responsible - not so much a royal act of revenge as a warning to powerful men not to get above themselves.