Villagers defied a novel coronavirus curfew to help rescue the small whales on Monday, wading into the breaking surf to push them back into the sea at Panadura, south of the capital, Colombo.
"We pushed back all of them last night, about 100 to 120 whales," navy spokesman Captain Indika de Silva told Reuters.
Four of the whales died during the rescue operation, he said.
"I was fishing when I saw a dark patch and about 100 came ashore," fisherman Upul Ranjith said earlier.
"I don't know why this has happened. It's never happened before. This is the first time I've seen it," Ranjith said.
The phenomenon of whales getting stranded in shallow water remains largely a mystery to scientists.
In September, several hundred whales died in shallows off the coast of Australia in its biggest stranding on record and one of the largest in the world.