Croatia, officially the Republic of Croatia, is a country on the Adriatic Sea that lies at the crossroads of Central and Southeast Europe. It shares a maritime boundary with Italy to the west and southwest, and borders Slovenia to the northwest, Hungary to the northeast, Serbia to the east, Bosnia and Herzegovina and Montenegro to the southeast. With twenty counties, Zagreb, the country's capital and largest district, is one of the country's primary subdivisions. Croatia has a population of 4.07 million people and covers 56,594 square kilometers. Croats arrived in the 6th century, and by the 9th century, the region had been divided into two duchies. During the reign of Duke Branimir, Croatia was recognized as an independent country for the first time on June 7, 879. By 925, Tomislav had become the first ruler, and Croatia had been elevated to the level of a kingdom. Croatia formed a personal union with Hungary in 1102 during the succession crisis following the end of the Trpimirovi dynasty. In 1527, the Croatian Parliament voted Ferdinand I of Austria to the throne in the face of Ottoman invasion. The State of Slovenes, Croats, and Serbs was founded in Zagreb in October 1918, independent of Austria-Hungary, and incorporated into the Kingdom of Yugoslavia in December 1918. Following the Axis invasion of Yugoslavia in April 1941, the majority of Croatia was absorbed into the Independent State of Croatia, a Nazi-installed puppet state. The Socialist Republic of Croatia was established as a result of a resistance movement, and it became a founding member and constituent of the Socialist Federal Republic of Yugoslavia after the war. Croatia proclaimed independence on June 25, 1991, and the War of Independence lasted four years after the declaration. Croatia is a republic ruled by a parliamentary structure and is a sovereign state. It is a founding member of the Union for the Mediterranean, the European Union, the United Nations, the Council of Europe, NATO, and the World Trade Organization. Croatia has been an active participant in UN peacekeeping, contributing troops to the International Security Assistance Force and holding a nonpermanent seat on the United Nations Security Council for the 2008–2009 term. The Croatian government has been investing in infrastructure since 2000, especially transportation routes and facilities along Pan-European corridors. Croatia is listed as a high-income economy by the World Bank and ranks very high on the Human Development Index. The economy is dominated by the service, manufacturing, and agricultural sectors, in that order. Croatia is one of the top 20 most popular tourist destinations in the world, so tourism is a major source of revenue. With massive government spending, the government controls a portion of the economy. Croatia's most powerful trade partner is the European Union. Croatia offers social security, universal health care, and tuition-free primary and secondary education, as well as cultural support by public institutions and mainstream media and publishing investments.