Hannes Þórður Pétursson Hafstein (4 December 1861 – 13 December 1922) was an Icelandic politician and poet. In 1904 he became the first Icelander to be appointed to the Danish Cabinet as the Minister for Iceland in the Cabinet of Deuntzer and was – unlike the previous Minister for Iceland Peter Adler Alberti – responsible to the Icelandic Althing.
He was born on the farm Möðruvellir in Hörgárdalur valley. His parents were Pétur Havstein (17 February 1812 – 24 June 1875) Governor of North and East Iceland and Kristjana Gunnarsdóttir Havstein (20 September 1836 – 24 February 1927) sister of Iceland’s first bank chairman, Tryggvi Gunnarsson.
He obtained the National Grammar School Leavng Certificate (stúdentspróf) in 1880 and obtained a degree in Law (Lower Second Class) from the University of Copenhagen in 1886. He was member of Alþingi in 1900–1901, 1903–1915 and 1916–1922. He attended his last meeting there in 1917.
He was proposed the first Minister of Iceland on 31 January 1904 from 1 February 1904, and he served as such until 31 March 1909. Then he became the CEO of the Iceland Bank.
In 1912 he was elected the president of Althingi prior to becoming minister of Iceland for the second time from 24 July 1912 to 21 July 1914, when he became CEO again. In 1917 his declining health forced him to resign his duties.
Hannes Hafstein died in Reykjavík on 13 December 1922. In 1931 a statue of Hannes by sculptor Einar Jónsson was unveiled in Reykjavik.