A national consciousness arose in the first half of the 19th century, inspired by romantic and nationalist ideas from mainland Europe. An Icelandic independence movement took shape in the 1850s under the leadership of Jón Sigurðsson, based on the burgeoning Icelandic nationalism inspired by the ''Fjölnismenn'' and other Danish-educated Icelandic intellectuals. In 1874, Denmark granted Iceland a constitution and limited home rule. This was expanded in 1904, and Hannes Hafstein served as the first Minister for Iceland in the Danish cabinet.