From the early 19th century, New Zealand was being visited by explorers, sailors, missionaries, traders and adventurers and was administered by Britain from the nearby colony at New South Wales. In 1840 Britain signed the Treaty of Waitangi with the natives of New Zealand, the Māori, in which Britain gained sovereignty over the archipelago. As British settlers arrived, clashes resulted and the British fought several wars before defeating the Māori. By 1870, New Zealand had a population made up mostly of Britons and their descendants.