The Hercules C-130 that declared a full emergency coming in to land at Whenuapai Airport in Auckland had earlier encountered a problem with its electrical generator.
The NZ Defence Force said the issues developed while en route to Nausori in Fiji.
Seven fire crews were at the airport after a C-130 Hercules declared a full emergency.
The crew reported smoke in the cockpit and was dumping fuel.
Full emergency was requested. The aircraft landed safely.
The NZ Defence Force said the smoke entered the cabin through the aircon system while the crew was attempting to isolate the problem with the faulty generator.
"The C-130 can operate safely at full capacity with a faulty generator with no impact to aircraft safety," it said in a statement.
"Nevertheless, it is standard procedure to turn back to the nearest suitable landing airfield following situations such as this."