The first European to encounter Guiana was Sir Walter Raleigh, an English explorer. The Dutch were the first Europeans to settle there, starting in the early 17th century, when they founded the colonies of Essequibo and Berbice, adding Demerara in the mid-18th century. In 1796, Great Britain took over these three colonies during hostilities with the French, who had occupied the Netherlands. Britain returned control to the Batavian Republic in 1802 but captured the colonies a year later during the Napoleonic Wars. The colonies were officially ceded to the United Kingdom in 1814 and consolidated into a single colony in 1831. The colony's capital was at Georgetown (known as Stabroek prior to 1812).