Three pilot whales and one dolphin died of their injuries following the mass beaching near the city of Panadura, south of the capital Colombo.
The rescue was conducted by the navy, with help from environmental protection officers, police and local residents.
It's thought to be the largest stranding in Sri Lanka. It is not known why whales beach themselves.
Local villagers defied a coronavirus curfew to join the navy and coast guard and help push the small whales back into deeper water so they could swim out into the ocean.