The Piast dynasty was the first historical ruling dynasty of Poland. It began with the semi-legendary Piast Kołodziej (Piast the Wheelwright). The first historical ruler was Prince Mieszko I (tenth century). The Piasts' royal rule in Poland ended in 1370 with the death of king Casimir the Great. Branches of the Piast dynasty continued to rule in the Duchy of Masovia and in the duchies of Silesia after 1370, until the last male Silesian Piast died in 1675. The Piasts intermarried with several noble lines of Europe, and possessed numerous titles, some within the Holy Roman Empire.
Although the early dukes and kings of Poland regarded themselves as descendants of Piast, the term "Piast Dynasty" originated in the 17th century: historians working for a number of rulers who governed duchies in Silesia invented the concept. In a historical book the term was first used by Adam Naruszewicz in his History of the Polish Nation (1780–86).
Piast Kołodziej (Piast the Wheelwright) was the legendary founder of the Piast dynasty. His name is first mentioned in the Cronicae et gesta ducum sive principum Polonorum of Gallus Anonymus, written c. 1113. The last Silesian Piast George William of Liegnitz-Brieg-Wohlau (Brzeg and Legnica) died in 1675, although numerous families link their genealogy to the Piasts. His son August Freiherr von Liegnitz (1628) and Graf von Liegnitz (1664), the last legitimate male, died in 1679 and the last male through illegitimate line Ferdinand II Freiherr von und zu Hohenstein of the Dukes of Teschen died in 1706. Another illegitimate branch, the Grafen von Karlinsmarck zu Friedland und Strehlitz, born of Bernhard of Silesia-Oppeln, duke of Falkenberg, by a lady Karlinska of Karlowice, died out at the beginning of the 19th century in a French family.