The Kaimai Tunnel is a railway tunnel through the Kaimai Range in the North Island of New Zealand. Since it was opened in 1978, it has held the title of longest tunnel, at 8.879 kilometres (5.517 mi), in New Zealand, assuming this distinction from the previous title holder, the Rimutaka Tunnel. It is part of the Kaimai Deviation, which was constructed to bypass the old route of the East Coast Main Trunk Railway through the Karangahake Gorge.