After being the homeland of illiterate Slav tribes for many centuries, Poland bursts into recorded history with unparalleled suddeness. The first mention of the Polanie tribe is in 963 when a German knight, pressing eastwards, comes into contact with them. They control the area round the town of Gniezno. Prince Mieszko has become, within the past year or two, their leader.

Threatened by German expansionism, Mieszko moves with extraordinary speed - using the structures of feudal Europe to secure his territory. Within a year or two of this first link with the German empire, he has himself accepted as a vassal of the newly crowned emperor Otto I.

In 965 Mieszko marries a Christian Czech princess. In the following year he adopts the Roman Catholic faith for himself, his family and all his people. To secure Poland's position even further, he subsequently places all his lands under the direct authority of the pope - thus providing the Poles, in principle, with the special protection of Rome.

Mieszko also gains territory for Poland, extending his realm north through Pomerania to the Baltic coast. He bequeaths a powerful kingdom to his descendants. Known as the Piast dynasty (because a later story traces their line back to a legendary ploughman of this name), they rule Poland for four centuries.

Poland divided: from1138

For several generations the descendants of Mieszko I develop and strengthen his unified kingdom, but Poland becomes fragmented after the reign of a particularly strong and successful ruler, Boleslaw III. On his death in 1138 the Piast inheritance is divided between several sons.

Weakened by these divisions, the Polish principalities are also plagued by incursions of pagan Prussians and Lithuanians who occupy the territories to the north. In about 1225 one of the Piast princes, Conrad of Mazovia, invites the Teutonic knights to help with this problem. They undertake the task with enthusiasm and success, bringing a significant increase in German colonization eastwards along the coast of the Baltic.

The Teutonic knights are a long-term threat to Poland's security, but the next few years bring a more immediate crisis in the sudden arrival of the Mongol horde of Batu Khan. Mongols sweep through the Polish plains in 1241, defeating an army at Legnica and ravaging Cracow - the capital of one of the most important of the fragmented Polish principalities.

Fortunately the Mongols withdraw at the end of that year, returning to the region round the Volga. The Poles soon repair the damage. But in the following decades the Polish principalities remain in political disarray, with power often in the hands of German bishops and merchants. By the end of the century there is even a military threat from neigbouring Bohemia.

Wladyslaw I and reunion: 1296-1333

The revival of a Polish national spirit is achieved, in opposition to Bohemian interference, by Wladyslaw - a Piast prince whose own inheritance is the small territory of Kujavia. In 1296 he acquires a more prominent role when the nobles of Great Poland (the region around Poznan in the west, as opposed to Little Poland around Cracow in the southeast) elect him as their prince.

However they almost immediately transfer their allegiance elsewhere, supporting instead a king of Bohemia who has been campaigning in Little Poland and has recently occupied Cracow. He is Wenceslas II.

By 1300 Wenceslas has gathered sufficient support to be crowned king of Poland at Gniezno. But his reign over the two kingdoms of Bohemia and Poland is interrupted by his early death in 1305.

He is succeeded by a 17-year-old son, also Wenceslas. The young king travels to Poland in 1306 to claim his second crown. During the journey he is murdered in his bed (it is not known by whom, but in spite of his tender years Wenceslas III already has a reputation as a libertine). His successor on the Bohemian throne, John of Luxembourg, revives the claim to Poland. But this time the Polish nobles finally elect their own prince, Wladyslaw.

Wladyslaw travels to Rome in 1305 to enlist the support of the pope for his cause. He then campaigns vigorously in Poland against the Bohemian faction. There is particularly strong opposition in Cracow, which has a German bishop and a city council controlled by Germans. In 1311 the city openly declares its support for his Bohemian rival.

Wladyslaw takes the city, ejects the bishop and bans the use of the German language in the council. In 1320 he is crowned king of Poland. Significantly he chooses for his coronation not the traditional Gniezno, but the recently rebellious Cracow. It becomes his capital city, and henceforth the place where all kings of Poland are crowned and buried.

Casimir III: 1333-1370

Casimir the Great, son of Wladyslaw, presides over a period of peace and prosperity in Poland. He has close family links with two powerful neighbours (he is married to the daughter of Gediminas, king of Lithuania, and his sister is the wife of Charles I, king of Hungary). This leaves only the Teutonic knights in the north and Bohemia in the southwest as hostile neighbours.

Growth of the towns, advances in learning (linked with the founding of a university in Cracow in 1364) and the provision of public buildings all testify to the wise patronage of Casimir - as does his unconventional decision to welcome to Poland the Jews displaced by persecution elsewhere after the horrors of the Black Death.

The only failure of Casimir, in dynastic terms, is that he has no son. He is therefore the last king in the direct line of the long-established Piast dynasty. The crown passes peacefully to his sister's son, Louis I of Hungary, who rules Poland as a somewhat absentee landlord from 1370. But Louis also has no son. On his death in 1382 he leaves two daughters, Maria aged eleven and Jadwiga aged eight.

Louis intends Maria to inherit Poland, leaving Hungary for Jadwiga. The Polish nobles decide otherwise. In 1384 they choose Jadwiga as their queen. And they arrange for her a marriage which brings great advantage to Poland. In 1385 Polish ambassadors visit Jogaila, now the king of Lithuania.