Polynesian explorers from Samoa first sailed south and settled Niue some time around 900 AD. Marauding Tongans (not to be messed with) arrived from the west in the 16th century. A system of monarchy was established around 1700.
That Pacific paramour Captain James Cook caught sight of Niue in 1774, but the locals didn't exactly roll out the red carpet. In fact, Cook was unable to land. As he wrote in his his journal, 'The conduct and aspect of these islanders occasioned my giving it the name of Savage Island'.
Christian missionaries converted the Niue 'savages' in the 1840s, but it wasn't until 1900 that the island became a British protectorate. The Brits didn't protest too ardently when New Zealand annexed Niue in 1901. Niue finally gained autonomy from New Zealand in 1974, but Niueans continue to hold NZ passports and NZ still coordinates the nation's foreign affairs and military operations.