Dozens of whales die stranded on Indonesian beach
Large crowds gathered as a rescue operation was launched, with volunteers using tarpaulins or just their bare hands to try to push the pod back out to sea.
Curious onlookers took pictures and touched the whales, while others tried to splash water on them.
In the end, only three of the animals survived.
"The live whales had to be released together as they live in a group," said East Java governor Khofifah Indar Parawansa in the statement.
Parawansa said that officials had taken samples of the carcasses for further investigation into the cause of death.
He added that the corpses, which measure from three to five metres each, would be buried on the beach at low tide.
Offshore cross-currents in the area pose a danger to whales, as they can get caught between reefs close to land.
Pollution, abandoned nets and floating plastic waste are also dangers for marine animals.
In July last year, 10 pilot whales were found dead near Kupang, a town in East Nusa Tenggara province.
In 2018, a sperm whale was found dead in Indonesia with more than 100 plastic cups and 25 plastic bags in its stomach, raising concerns about the Southeast Asian archipelago's massive marine rubbish problem.