"God Defend New Zealand" was written as a poem in the 1870s by Irish-born, Victorian-raised immigrant Thomas Bracken of Dunedin.[3] A competition to compose music for the poem was held in 1876 by The Saturday Advertiser and judged by three prominent Melbourne musicians, with a prize of ten guineas.[4] The winner of the competition was the Vandemonian-born John Joseph Woods of Lawrence, Otago, who composed the melody in a single sitting the evening after finding out about the competition.[5] The song was first performed at the Queen's Theatre, Princes Street in Dunedin, on Christmas Day, 1876.[4] In February 1878, sheet music was published.[4]