The company said the miners were forced to take shelter in three underground refuge chambers after a truck engine caught fire at about 5:00 am (1600 GMT Monday) at the Waihi mine on the North Island.
It said the miners made contact with colleagues on the surface and reported that none of them were injured.
Rescuers reached 13 miners in two of the chambers about five hours after the accident, then brought out the final 15 in the third chamber just before midday, the company said.
"We've had confirmation that the remaining 15 miners are on the surface, so everyone is now accounted for and well," the mine's operations manager Glen Grindlay told reporters.
He said while one of the men was suffering from possible smoke inhalation, they were all in good spirits.
Grindlay said the cause of the fire was unknown and subject to investigation.
The company said the mine was a hard rock gold mine and there was no danger of an explosion caused by underground gases.
Twenty nine miners died in November 2010 when methane gases exploded at the South Island's Pike River colliery, in New Zealand's worst mining disaster for almost a century.
What the stars mean:
★ Poor ★ ★ Promising ★★★ Good ★★★★ Very good ★★★★★ Exceptional