The Croats arrived in the early seventh century in what is Croatia today. They organized the state into two dukedoms. The first king, King Tomislav was crowned in AD 925 and Croatia was elevated into the status of a kingdom. The Kingdom of Croatia retained its sovereignty for almost two centuries, reaching its peak during the rule of Kings Peter Krešimir IV and Demetrius Zvonimir. Croatia entered a union with Hungary in 1102. In 1526, the Croatian Parliament elected Ferdinand from the House of Habsburg to the Croatian throne. In 1918, Croatia declared independence from Austria–Hungary and co-founded the Kingdom of Yugoslavia. An independent Croatian state briefly existed during World War II. After World War II, Croatia became a founding member of the Second Yugoslavia. On 25 June 1991, Croatia declared independence and became a sovereign state.