Floods forced the evacuation of 1, 700 prisoners from Pra Nakorn Sri Ayutthaya jail in central Thailand because of fears for their safety.
The inmates left the building under armed guard clinging to a rope stretched between its gates and a heavy truck as the flood waters swirled around them.
Water has submerged large areas of the prison in an old town of Ayutthaya province 105 kilometres north of Bangkok.
All the inmates were transferred to other nearby jails.
Residents in Ayutthaya are also struggling to cope with the floods.
The 400-year-old World Heritage Chai Wattanaram temple in the same province has also fallen victim.
The flooding has claimed at least 244 lives in Thailand since mid-July.
Another 167 people have been killed in neighbouring Cambodia.
Fifteen more have died in Vietnam.
One United Nations agency has said the floods are the worst to hit parts of Southeast Asia in half a century.
The Centre for Economic and Business Forecasting in Thailand has cut its forecast for GDP growth this year by nearly one per cent because of the disaster.