After being ruled by various different noble families (Counts of Werdenberg, Sulz, Brandis, Hohenems), Schellenberg and Vaduz were purchased by Prince Johann Adam in 1699 and 1712 respectively. In 1719 they were merged and raised to the status of an Imperial Principality, before becoming a sovereign state in 1806. The 19th century was marked by great poverty that resulted in many people leaving the country, mostly for the USA.
The last counts to rule the area today known as Liechtenstein were the Counts of Hohenems. It was under their rule that the witch trials were held. Due to their large debts they were forced to sell the County of Vaduz and the Dominion of Schellenberg. In 1699 Prince Johann Adam purchased the Dominion of Schellenberg and in 1712 the County of Vaduz. The two territories were united via an imperial diploma issued by Emperor Karl VI on 23 January 1719, creating an Imperial Principality bearing the name Liechtenstein. As this new country only comprised small farming villages, the administrative authority was established in the nearest town, Feldkirch, where the Prince built the Palais Liechtenstein for the administrative staff.
Over the course of history Liechtenstein has been occupied by foreign troops on several occasions. During the War of the First Coalition (1792-1797) French soldiers entered the country; after battles between Austria (with support from Russia) and France, Liechtenstein was occupied by Napoleonic troops during the War of the Second Coalition (1799-1802). In 1806 Napoleon accepted the country as one of the founding members of the Confederation of the Rhine, thereby making Liechtenstein an independent state. This independence was confirmed at the Vienna Congress, with Liechtenstein becoming a member of the German Confederation.
Liechtenstein developed slowly and remained underdeveloped for many years. The revolution in 1848 did not lead to an immediate change in the situation. It was not until the customs treaty with Austria in 1852 that economic conditions began to improve, with the 1862 constitution bringing about political change by placing for the first time restrictions on the Prince's power to rule.