As sea waters slowly rose around his temple and his neighbours fled inland, Thai abbot Somnuek Atipanyo refused to budge and is today a symbol of the fight to restore the country's fast-eroding coastlines.
A dangerous combination of climate change, industrial farming and rapid urbanisation are endangering the Gulf of Thailand's coasts, stripping away precious mangrove trees and leaving some buildings like Somnuek's surrounded by sea water.
In the 30 years since the waters started encroaching, most of his neighbours in the fishing village of Samut Chin moved several hundred meters inland to rebuild their wooden homes.
Standing in his saffron robes near his monastery on stilts -- dubbed the "floating temple" -- the 51-year-old monk points out to sea at the spot where the local school once stood.
"This temple used to be in the middle of the village," he tells AFP in Samut Chin, about an hour south of Bangkok.
"If we moved it, people wouldn't even know there had ever been one here," he says of the temple, accessible only by a small footbridge today.
These shores were once protected by extensive mangrove forests -- the Gulf of Thailand boasts some of the largest in the world -- a natural defence against coastal erosion thanks to their extensive roots that stabilise the shoreline.
But it's a been a losing battle to preserve them.
- Replanting in the 'heart' -
Mangrove forests have been cleared for extensive development of shrimp and salt farms, along with new houses and hotels that have popped up thanks to a development boom in recent decades.
Thailand lost almost one third of its vast coastal mangrove forests between 1961 and 2000, according to a report from the nation's Department of Marine and Coastal Resources and the UN Environment Programme.
Climate change is also having an impact: stronger waves and more ferocious monsoons have wiped out mangroves in the Gulf of Thailand, which is especially vulnerable because its waters are so shallow.
"The waves and tides are higher than before," said Thanawat Jarupongsakul, who advises Thailand's government on its policy to combat erosion.
Asian and Caspian coastlines are the two areas in the world most affected by coastal erosion, according to a study published last year in the scientific journal Nature.
It's a global problem: tens of thousands of square kilometres of land have been lost from coastal erosion around the world -- between 1984 and 2015 the equivalent of the surface area of Haiti was lost, the study said.
In Thailand a quarter of the country's shores -- or about 700 kilometres (500 miles) -- are eroding, some "severely", according to data shared with AFP by the Department of Marine and Coastal Resources.
Now there is a push to restore Thailand's precious mangrove ecosystem through a national voluntary tree replanting scheme, including near Somnuek's island monastery.
On a recent sunny afternoon, scores of people spent the day wading chest-deep in the sea to replant mangrove trees.
Clad in headscarves and hats, they gingerly reach down into the water to plant young saplings along lines of bamboo poles that help offer some protection against the waves.
"This project is called 'Planting a forest in people's hearts,'" said Wason Ditsuwan, who runs the program.
Set up in 2016 by Bangkok city authorities, the project has so far replanted 84 acres of mangroves across the country.
- Temple selfies -
Wason is hoping his project will succeed where others have failed.
Nearly 10 years ago, government adviser Thanawat helped residents in Samut Chin replant mangrove trees but some areas were too far gone to recover.
"Even if you plant a lot of mangroves, it cannot help," he said.
Another strategy is to drill pylons of cement into the seabed -- and on the shoreline itself -- to act as a substitute for the mangrove roots.
This has proven successful so far in the tourist town of Pattaya further along the coast, where the pylons have helped to reclaim several metres of beach.
But it's a race to keep up with rapid development along the shore, Thanawat said.
As for Somnuek's stretch of coast, though further erosion has stopped for now, there is little hope his temple will ever see dry ground again.
But the flooding has brought one unexpected advantage: dozens of tourists that flock to the so-called floating temple for Instagram-worthy selfies.
"The fight against coastal erosion has brought fame," village head Wisanu Kengsamut said.