Casimir II, called the Just (Polish: Kazimierz II Sprawiedliwy; 1138 – 5 May 1194), of the Piast Dynasty, was the youngest son of Boleslaus III by Salome von Berg-Schelklingen, daughter of Henry, Duke of Berg (of Wuerttemberg). He reigned as Duke of Kraków and senior prince of Poland (see Seniorate) from 1177 until his death.
Born shortly before or after his father's death, and omitted (possibly for that reason) from Boleslaus' will dividing the kingdom among Casimir's four elder brothers, he set about securing the basis for a claim to power. In 1167, he inherited from his brother Henry the dukedom of Wiślica, and in 1173 he obtained that of Sandomierz.
Sometime between 1160 and 1165 Casimir married Princess Helen of Znojmo.
In 1177, a rebellion by the barons of Lesser Poland against Mieszko III the Old led to the elevation of Casimir to the ducal throne of Kraków. In order to end internal conflicts within the decentralised Polish state, Casimir distributed lands to his nephews: Poznań to Otto, son of Mieszko the Old; Kuyavia to Leszek; Silesia to Boleslaus the Tall; Bytom, Racibórz, Oświęcim, and Siewierz to Mieszko; and Głogów to Conrad. Mieszko the Old was forced to give up Greater Poland to Otto.
In 1180, Casimir called an assembly of nobles at Łęczyca. He granted privileges to the nobles and the Church, lifting a tax on the profits of the clergy and relinquishing his rights over the lands of deceased bishops. By these acts, he won acceptance of the principle of hereditary succession to Kraków, though it would take more than a century to restore the Polish kingship.