One incident in particular sticks with Ernest Gordon. During the Second World War an Australian private had been caught outside the Japanese prisoner-of-war compound, trying to obtain medicine from the local Thai people for his sick friends. He was to be executed. On the morning of his execution the soldier marched cheerfully to the parade ground. Slowly, he pulled a small copy of the New Testament from a pocket of his shorts and read a passage to himself. His lips moved but no sound came from them. And no one knows what he read. But he finished reading, looked up and smiled at the padre, who was looking very distraught. The Australian assured him he would be fine. Then he nodded to the executioner as a sign that he was ready. A samurai sword flashed in the sun.

Ernest Gordon talks slowly and softly, conferring weight to these private moments, as he pushes his walking frame towards the elegant lounge of Acorn Glen, an assisted-living residence in the serene landscape of historic Princeton, New Jersey. Once in the room he slumps easily into a padded chair. Momentarily he lifts his head and gazes balefully at something unseen. On the other side of the room a day-care assistant fusses over her charge, trying to convince him to sit on a larger, more comfortable sofa closer to the fireplace. Gordon is having none of it. This tall, 85-year-old Scotsman waves her off with a gentle rebuttal, and a flashing grin. ''Away with you,'' he says, ''I'm alright.''

He now sits surrounded by 100-year-old birch, American elm and pine trees, overlooking a flowing rock and boulder stream, almost a lifetime away from being marched with other British prisoners deep into the south-east Asian jungles to build the infamous Burma-Siam Railroad over the River Kwai - commonly known as the Railway of Death. ''It was like waking from a dream,'' he says. ''I suddenly realised I was in the 'death house', in a prison camp by the River Kwai. I was a company commander in the 93rd Argyll and Sutherland Highlanders, but now I was also a prisoner of war, lying among the dead, waiting for the bodies to be carried away so that I might have more room.''

As a 24-year-old commander in the Highlanders, Gordon - who was born in Greenock - faced unspeakable atrocities following his

capture while trying to escape from Sumatra after the fall of Singapore. In February 1942 he was picked up by a Japanese frigate and taken to Changi, a prison camp ten miles from the docks. While conditions at the camp were fairly difficult, they were nothing compared to what lay in store. In September that year he was transferred to the notorious Chungkai camp and informed he and his fellow prisoners would be building a railway for the Japanese. ''Under normal conditions the railway would have taken five or six years to build, but the Japanese wanted it built within months,'' he says.

It took around a year to build and, although not completed, it extended 250 miles, from Myanmar to Thailand, cutting through some of the world's most inhospitable terrain. It was

initiated to provide a rail link between Thailand and Burma for logistical troop support. Around 65,000 allied PoWs, and more than 300,000 labourers, mainly from south-east Asian countries under Japanese occupation, were used as slaves. Two bridges were built over a jungle river, the Khwae Noi, as part of the prisoners' forced labour. Almost 16,000 Allied prisoners died during its construction.

''Every morning at dawn we were marched from Chungkai to work at hacking out the road for the railroad. We were not marched back until late at night. We did this seven days a week and lost all consciousness of time. One grey day succeeded another. Misery, despair and death were our constant companions.'' Except for a thin cloth, the men worked naked and barefoot in heat which reached 120oF. When the

monsoons arrived the men worked and lived in a completely wet world. As the Japanese grew increasingly anxious that the project would not be completed they beat the men mercilessly and those who no longer had the heart to endure such beatings died.

During his four years' imprisonment, the Japanese military violated every civilised code, murdering prisoners of war by bayoneting, shooting, drowning, decapitating or just beating them to death. Working them beyond the limits of human endurance, they also murdered them covertly. For those prisoners who did not comply with certain orders, many were tortured by having their heads crushed in a vice; some were tied to a tree by their thumbs, while others were buried alive in the ground. One of the hardest things to come to terms with, he says, was the futility of the deaths of so many men.

In the early months and years of their captivity the men had no words of mercy when a man lay dying. When someone cried for help, they averted their heads. Men cursed the Japanese, their neighbours, themselves and God. ''Everyone was his own keeper,'' says Gordon, and what exuberance once rose from his compact and unmistakably elegant Scottish burr now seems lost. In its place is a voice almost choked by memory. ''It was free enterprise at its worst, with all the restraints of morality gone. Although we lived by the law of the jungle the strongest among us still died, and the most selfish, the most self-sufficient, the wiliest and clever. They all perished, along with the weak.

''For a long time hate, for some, was the only motivation for staying alive. We hated the Japanese and we would willingly have killed them, torn them apart, if they had fallen into our hands. But over time even our hatred died, giving way to numb, black despair.'' Such was the harshness of the Japanese regime that less than three years into captivity, suffering from malnutrition, diphtheria, polyneuritis, dysentery, malaria and worms, Gordon finally accepted the inevitability of his own impending death.

His remarkable story is the subject of a recently completed film, To End All Wars (based on his book Through the Valley of the Kwai), starring Robert Carlyle, Kiefer Sutherland and Ciaran McMenamin, who portrays Gordon. It is a story which is, in spite of, or perhaps because of, the degradation and inhumane treatment he and his fellow prisoners received, almost miraculous in its salvation and redemption. What spurred him on, he recalls, was half-remembered passages from the Bible (eventually, Gordon grew to be a man of faith, called to Christian ministry, allowing him to

forgive his enemies).

''I remember lying there one night when two British medical orderlies appeared with a stretcher swaying between them,'' he recalls. ''They said they had brought me another one for company. When I looked around the yellow glow of the makeshift lamp gave enough light for me to see my comrades, ten dead men dressed in their shrouds of straw rice sacks. It was difficult to tell that they were corpses. They might have been old rags or old bones. I didn't really mind. Corpses were as common among us as empty bellies.'' The young soldier was lying on a slightly less muddy terrain, a more desirable section of the death house, which was a bamboo hut. It was supposed to be a hospital but had long given up any pretence of being somewhere which sheltered the sick - ultimately, it was a place where the soldiers came to die. ''Death was everywhere,'' he says. ''It was in the food we ate, the air we breathed

and even the things we talked about.''

It was from here that he wrote a final letter to his parents in Scotland telling them to spend his small amount of savings on themselves. ''If one of my friends passes this on to you it will mean that I've guessed wrongly and that I'm not coming back. I'm sorry. I'd have made it if I could ... Don't have any regrets. I suppose it just couldn't have been otherwise. I've enjoyed life. I'm glad I was brought up in the country with the sea at the front of the house and the hills at the back. I'm glad I had you as parents ... There's a great deal of good about life that will never die. There's a goodness at the heart of it, I believe.''

Incredibly, despite years of constant abuse, inhumane treatment and unrelenting labour in the camps, Gordon survived, saved by three fellow prisoners, one who sold his watch to buy the drugs needed to treat him. Another constantly washed and dressed his wounds. ''I remember on my birthday, in 1943, Dusty Miller, one of the prisoners who was nursing me, made a cake from boiled rice, bananas, palm sugar and lime. It became a very important symbol for me, a symbol of life, because it showed me that, despite the conditions suffered by everyone, someone cared for me. I began to feel that I had to survive. Once I started to feel that my will to live was returning, my body began to feel better.''

Despite being ill for six months his recovery changed the mood of the camp, to the extent that the rest of the soldiers began to sacrifice their own well-being for that of others. ''One of the men died after he gave up his meagre rations to his friend who was starving to death. I remember these things as if it was yesterday. It was awful, yet it helped re-affirm your faith in humanity.'' In an attempt to keep his fellow prisoners alive, spiritually as well as physically, he even managed to start an orchestra and a college of liberal arts inside the prison camp.

The soldiers were sent six violins from a YMCA in Britain and Gordon used them as the main part of his orchestra. They fashioned drums from oil barrels, woodwind instruments from bamboo and, using a large tea box and cow gut, they constructed a bass viola. Amazingly, the Japanese did not object. Instead, they encouraged the music, more from a desire to be entertained than any feelings of altruism. ''We realised that beauty can be anywhere,'' he says. ''The orchestra raised the men's spirits to new heights.'' The prisoners began to meet regularly in the death house, which the guards avoided because of the stench of rotting corpses, to plan their meetings. ''I just wanted to encourage the rest of the men to make sacrifices for the good of the others.'' A church was formed in a clearing and it was here that Ernest preached his message of forgiveness.

Initially, the Japanese officers allowed these gatherings, but soon stopped the men when they realised what a profound effect the meetings were having on morale. Undaunted, Gordon and the rest of the men responded by holding meetings outside the camp, praying while on the railway construction tracks. With soaring spirits, their war was soon to be over. Gradually, the Japanese began to get more agitated as more and more Allied planes flew overhead. The area was bombed constantly and on June 24, 1945, the RAF finally destroyed the bridge that had succeeded in destroying so many lives.

Atomic bombs were then dropped on Japan and, on August 14, the Japanese surrendered. The men, who for so long had been bound together by pain, death, joy and tragedy, quietly turned to each other and shook hands. A lone voice sang Land of Hope and Glory.

''The wounded Japanese looked at us forlornly as they sat waiting for death,'' says Gordon. ''These were the enemy. They were more cowed and defeated than we had ever been. Without a word most of the officers in my section unbuckled their packs, took out part of their rations and a rag or two, and handed them water canteens. Our new guards tried to prevent us. But we ignored them and knelt down by the enemy to give water and food, to clean and bind up their wounds. 'What fools you are!' an Allied officer called to us. Have you never heard the story of the Good Samaritan? I asked him.''

An almost miraculous conversion had taken place. The men no longer felt the hatred that once ate away at them while they suffered at the hands of the Japanese. ''Now these same men were dressing the enemy's wounds. All of us had experienced something approaching grace. I think we all began to realise that bitterness was not an option. Although no one would ever

forget what happened, some of us discovered we could forgive.''

Upon his return to Scotland it took two months for his health to stabilise, although it took a lot longer for him to feel normal again. The Britain most of his fellow soldiers had known was the country of 1939 and it was now six years later. ''Our families and friends would have known us as boys and we were far from boys.'' In December 1945, only 17 days after meeting her again, he married Helen, a close friend he had known from before the war, and the couple had two children. She died, four years ago, aged 80.

A graduate of the University of St Andrews and recipient of numerous medals and honours, Gordon moved to America after the war to

complete his graduate studies at Hartford

Theological Seminary. Following his graduation, he returned to Scotland to continue studies in history and to serve as one of the ministers at Paisley Abbey. Three years later, he returned to America and became Dean of the Chapel at Princeton University, a position he maintained for 26 years. He is now Chaplain Emeritus at the same university.

Gordon has been given a starring role in To End All Wars and he returned to Bangkok two years ago, where he was filmed for the picture's last scene. At the Memorial Cemetery there for British soldiers, he and a former Japanese officer, Nagase Takashi, reconciled. Together, the men laid a wreath on the memorial and, in their respective languages, spoke about reconciliation. ''I have no idea how many men are buried there,'' he says. ''The cemetery was enormous and the spread of bronze tablets of British soldiers buried there is enormous. I am not normally an emotional man, but when I saw the graves of some of my men, well, it was difficult. It was terribly, dreadfully sad.''

We finish our conversation and I get up to leave. ''The important message for me is that love can conquer all, despite the harshness and dreadfulness of the situation,'' says Gordon. ''There is something dignified in all men, in all situations. God came to the death house and helped guide some of us through it.'' There is a quality in Ernest Gordon that is invisible from a distance, but up close, listening to his experiences, is altogether more formidable. n

To End All Wars goes on general release this autumn. Miracle on the River Kwai, by Ernest Gordon, will be republished by HarperCollins to coincide with the film.