During the First Taranaki War, Te Kepa made clear his continuing loyalty to the government. In 1864, the Maori tribes on the Upper Wanganui River converted to Hau Hau-ism and threated to invade Wanganui town. Te Kepa led the tribes of the lower river to defend the town. The result was the Battle of Moutoa Island and a substantial defeat for the Hau Hau, on 14 May 1864.
This was the start of six years of warfare for Te Kepa, always fighting on the side of the Pakeha government, usually working closely with Captain Thomas McDonnell. In February 1865, Te Kepa and his force of Wanganui Maori warriors took part in the attack on Ohoutahi Pa, a major Hau Hau stronghold. following the murder of the missionary Volkner, they were shipped to the other side of the country, to Opotiki. However they soon returned to Taranaki and were involved in the capture of Wereroa Pa and then the relief of Pipiriki.
Te Kepa gradually built up a personal contingent of between one and two hundred warriors, men who were paid by the government but whose loyalty was to him and his mana as a fighting cheiftain. In 1868, he and his men were involved with the insurgency of Titokowaru. Te Kepa commanded the rearguard during the retreat from Te Ngutu o Te Manu after the government forces had been defeated and again in similar circumstances after the Battle of Moturoa. Te Kepa commanded the force pursuing Titokowaru after he abandoned his Pa at Tauranga Ika. It was the first time that British soldiers, officers and men had served under a Maori commander, by this time Te Kepa had been promoted to the rank of major.
As soon as Titokowaru ceased to be threat, Te Kepa and his men were transported to the East Coast to join in the pursuit of Te Kooti Such was his reputation that the attack on Te Porere near Tongariro was delayed until Te Kepa and his men arrived; they were marching up the Wanganui River in the face of snowstorms and volcanic eruptions.
The final pursuit of Te Kooti through the Ureweras was largely handed over to Te Kepa and another Maori war leader, Ropata Wahawaha. He and his men returned to Wanganui in 1871. Over the following years he was honoured with the Queen's Sword of Honour, 1870, the New Zealand Cross 1874 and the New Zealand War Medal, 1876.
In 1871 Te Kepa was appointed as a land purchase officer in Wanganui. He saw this as an opportunity to correct some of the wrongs done to his people during his childhood, a chance to regain some of the land they had lost to the Ngati Raukawa by conquest. This almost brought the tribes to war, Te Kepa threatened to call upon his personal following of warriors if the government did not back up his decisions. There were some violent clashes before the issue went in his favour.
In 1880, Te Kepa set up a Maori Trust to protect Maori land from European buyers, a large area of inland Wanganui was declared off limits to all Europeans. This provoked the government, but Te Kepa's large personal following of warriors meant they were very cautious in dealing with him. In addition, he had the support of some members of the government, including the Native Minister, John Ballance.
During his remaining years Te Kepa sought to unify the two races as one people based on equality and respect.
Te Kepa Te Rangihiwnui died at Putiki on 15 April, 1898.