The two-metre-long fish, estimated to weigh up to half a tonne, was discovered in Otago Harbour near Dowling Bay yesterday.
Department of Conservation Otago coastal biodiversity ranger Jim Fyfe said initially witnesses thought the giant fish was a shark.
"The fin sticking up out of the water looked a bit shark-like, so we sent a Doc volunteer out to check it out, and she reported back that it was a sunfish.
"It’s not completely unusual. We get a number of sightings of sunfish in Otago waters — probably a couple each year," Mr Fyfe said.
He said the harbour was a trap for them because they were an oceanic species, preferring deep water.
When they got into shallow water, it forced them on to their sides which blocked their gills and suffocated them.
He said Doc staff attempted to reach the sunfish and guide it back out to sea, but were unable to get to it in time.
It washed up on the beach at Dowling Bay.
Mr Fyfe said the fish was possibly a hoodwinker sunfish (Mola tecta), like the one on the wall at the Otago Museum.
In 2017, it was found to be a member of the first new sunfish species to be identified for 130 years.
Hoodwinkers are generally found in the cold waters of New Zealand, southern Chile, South Africa and the southeast coast of Australia.
Sunfish can grow up to three metres long and can weigh up to two tonnes, he said.