Image copyright AP Image caption Zamperini was held in solitary confinement for long stretches and told he would be executed

Louis Zamperini, an Olympic runner and American World War Two veteran who survived two years as a prisoner of war, has died at the age of 97.

He died peacefully on Wednesday after a 40-day battle with pneumonia.

"His indomitable courage and fighting spirit were never more apparent than in these last days," his family said in a statement.

Zamperini's life was the subject of the 2010 book Unbroken and an upcoming film adaption to be released this year.

The film's director Angelina Jolie said his death was "a loss impossible to describe".

"We are all so grateful for how enriched our lives are for having known him. We will miss him terribly," she said in a statement.

The son of an Italian-immigrant father, Zamperini was born in 1917 in New York state and ran competitively at his high school and the University of Southern California.

In the 1936 Berlin Olympics, at 19 years old, he placed eighth in the 5,000m distance run. He ran the last lap in 59 seconds, earning him a handshake from Adolf Hitler.

Image copyright AP Image caption Louis Zamperini finished a mile run in four minutes and 16 seconds in Seattle in May 1939

He left competitive running to enlist in the US Army in 1941, before the Japanese attack on Pearl Harbor.

Zamperini served as a bombardier in World War Two and was searching for a downed military plane when his own crew crashed into the Pacific Ocean.

The crash killed eight of the 11 men on board. Zamperini survived 47 days adrift on a raft.

"We had rations of concentrated chocolate aboard, but during a storm the first night it all went overboard," he told an interviewer in 1988. "All we had left was three pints of water in cans."

They caught fish and sharks to eat and collected rainwater to stay alive.

He and the other survivors were eventually picked up by a Japanese patrol and spent the next two years in Japanese prison camps, including weeks solitary confinement on an island called Kwajalein where he was told he would be executed.

Zamperini was then held in an unregistered POW camp near Yokohama and tormented in particular by one guard he came to call "The Bird".

"There were constant beatings, punishments and torture, especially when bombers came over," he said.

He told an interviewer he later refused to broadcast Japanese propaganda messages in exchange for more comfortable accommodations.

The US declared him killed in action during his time as a war prisoner.

Image copyright AP Image caption Louis Zamperini (right) with Captain Fred Garett after returning from Japan

He returned home after the war, married and became a devout Christian after meeting evangelist Billy Graham.

During the 1998 Winter Olympics in Japan, he ran a leg of the torch relay.

In May, Zamperini was chosen to serve as grand marshal of the 2015 Rose Parade, ahead of the college football playoff game in his home state of California.

Unbroken was written by best-selling author Laura Hillenbrand.

The film adaptation is scheduled for release in US theatres in December.