Two young elephants washed out to sea have been saved from drowning by the Sri Lankan navy in the second such incident off the island in as many weeks.

The navy said the pair of wild elephants were brought ashore on Sunday after a mammoth effort involving navy divers, ropes and a flotilla of boats to tow them back to shallow waters.

Photos showed the elephants in distress, barely keeping their trunks above water in the deep seas about half a mile off the coast of Sri Lanka.

“Having safely guided the two elephants to the shore, they were subsequently released to the Foul Point jungle [in Trincomalee district],” the navy said in a statement. “They were extremely lucky to have been spotted by a patrol craft, which called in several other boats to help with the rescue.”

Facebook Twitter Pinterest An elephant rescued by the Sri Lankan navy after getting swept out to sea on 12 July. Photograph: AFP/Getty Images

Two weeks ago, the navy mounted a similar operation in the same region to save a lone elephant washed five miles off the Sri Lankan coast into the deep waters of the Indian Ocean. Navy officials say the animals were likely swept out while crossing shallow lagoons in the region.

They are not the only wildlife to encounter trouble in the biodiverse island. In May, the navy and local residents saved a pod of 20 pilot whales that became stranded in Trincomalee, a natural harbour that is popular for whale-watching.

The waters around Trincomalee, which were used by allied forces as a staging post during the second world war, have a high concentration of blue and sperm whales, while the surrounding jungles have herds of wild elephants.