The navy said the pair of wild elephants were brought ashore 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 one kilometre 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.
Two weeks ago, the navy mounted a similar operation in the same region to save a lone elephant washed eight kilometres (five miles) off the Sri Lankan coast into the deep waters of the Indian Ocean.
More From This Section
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.