Two pygmy sperm whales have died after being washed ashore in wild weather on the New South Wales mid-north coast.

The mother and her calf were discovered in heavy surf on Gallows Beach at Coffs Harbour yesterday.

National Parks and Wildlife Service spokesman Lawrence Orel says the whales were too weak and had to be put down.

"There was quite a bit of effort to recover them," he said.

"However, acting on the vet's advice unfortunately the prognosis for the mother and calf had suffered as a result of the stranding and they just wouldn't be able to make it."

Weather in the area is deteriorating as the remnants of ex-tropical cyclone Oswald, which has wreaked havoc in Queensland, make their way south.