The kingdom of Denmark ruled Norway until May 1814, when Sweden defeated Denmark in the Napoleonic Wars. On 4 November 1814, Sweden took control of Norway, and the United Kingdoms of Sweden and Norway shared a Swedish monarch. Still, Norway retained its own separate governing body for local affairs.
Norway's Venstre Party and other liberal groups gained the support of the working class. In 1884, the Venstre Party formed the Norwegian Labor Association, bringing together industry workers and agricultural workers in one organization.