The military history of New Zealand is an aspect of the history of New Zealand that spans several hundred years. When first settled by Māori almost a millennium ago, there was much land and resources, but war began to break out as the country's carrying capacity was approached. Initially being fought with close range weapons of wood and stone, this continued on and off until Europeans arrived, bringing with them new weapons such as muskets. Colonisation by Britain led to the New Zealand land wars in the 19th century in which settler and imperial troops and their Māori allies fought against other Māori and a handful of Pākehā. In the first half of the 20th century, New Zealanders of all races fought alongside Britain in the Boer War and both World Wars. In the second half of the century and into this century the New Zealand Defence Force has provided token assistance to the United States in several conflicts. New Zealand has also contributed troops extensively to multilateral peacekeeping operations.
The level of intertribal warfare amongst pre-European Māori is unknown. Oral histories, legends and whakapapa include many stories of battles and wars but little research has been carried out into how often wars actually happened. In Making Peoples James Belich argues that they were probably uncommon in the few centuries immediately after the arrival of Māori in New Zealand in about 1280 CE, as there was ample land and resources to go around. Archaeological evidence suggests that following population growth and the extinction of the moa (a large flightless bird), warfare increased as tribes and hapū (subtribes) competed over scarce resources. At some point, perhaps before this cultural change, one group migrated to the Chatham Islands, where they developed the largely pacifist Moriori culture. Their pacifism left the Moriori unable to defend themselves when the islands were invaded by mainland Māori in the 1830s.