The Polish state has a history of more than a millennium; in the 16th century, under the Jagiellonian dynasty, and especially under John III Sobieski, it was one of the most powerful and influential European countries, only to cease to exist for 123 years, being divided between the Russian Empire, the Austro-Hungarian Empire and the Kingdom of Prussia. Independence was regained in 1918, following the First World War, as the Second Republic of Poland. After World War II, it became a satellite state of the Soviet Union, known as the Polish People’s Republic (Polska Rzeczpospolita Ludowa or PRL). In 1989 the first free elections after the Second World War ended with the freedom movement winning against the Communist Party. Part of the Schengen Agreement, Poland was admitted to NATO on 12 March 1999, while its entry into the European Union took place on 1 May 2004.