In a 12-hour rescue operation dubbed a "miraculous escape" Sri Lanka's navy has saved an elephant that was swept out to sea.

The elephant was spotted struggling to stay afloat 8km off the island's northeast coast, a navy spokesman said on Wednesday.

It is believed the elephant was swept into the sea while trying to cross the Kokkilai lagoon, a large stretch of water that lies between two areas of jungle.

Navy divers spent 12 hours rescuing the distressed elephant, tying ropes to it and gently towing it shallow waters.

Advertisement

Navy spokesman Chaminda Walakuluge called the exercise a "miraculous escape".