Hundreds of dead whales washed up on a New Zealand beach have been cordoned off from the public because they are at risk of exploding as they decompose.

Workers in protective clothing are cutting holes in the 300 carcasses that remain washed up on Golden Bay at the tip of the South Island after one of the country's largest strandings. Another 300 whales managed to survive, and were either refloated by volunteers or swam away.

The Department of Conservation said that workers would pop them with knives and two-metre long needles to allow internal gases to be released, Reuters reported.

They would take several months to turn into skeletons.

Some 400 pilot whales, which grown to about 7.5m long, were rescued when they landed on the beach on Friday (10 February) and are now swimming about 6km offshore.

It is not yet known what caused the strandings but marine experts say shallow waters can muddle its sonar, or they may have been chasing prey too close to shore.

Whale strandings are common in New Zealand and this is its third-biggest in recorded history.

DOC spokesman Herb Christophers said he hopes the strandings are over but that it was possible the mammals might return to the beach again.

New Zealand whales
Volunteers try to assist stranded pilot whales that came to shore in the afternoon after one of the country's largest recorded mass whale strandings, in Golden Bay, at the top of New Zealand's South Island. Reuters