LOS ANGELES — Seventy years ago, the world was convinced Louis Zamperini was dead. There had been no word of the track star and former Olympian since his World War II bomber crashed into the Pacific. The military told his parents he was dead, and an annual collegiate-track competition named a race in his memory.

But Mr. Zamperini was alive. After surviving 47 days in a life raft in shark-infested waters and enduring two years as a Japanese prisoner of war, Mr. Zamperini was liberated in time to attend the second running of the invitational mile that had been named in his memory.

Mr. Zamperini, a war hero, Olympian and the subject of a celebrated book and upcoming movie on his story of survival, died of pneumonia Wednesday, his family said Thursday. He was 97.

An athlete who stayed trim his entire life, Mr. Zamperini gave up skateboarding at 81. Ten years later, he gave up skiing. In May, he was named grand marshal of the 2015 Rose Parade in Pasadena.

    Most Read Stories

He credited years of rigorous training and competition with helping him to survive the war. “The only way I can put it that makes sense is that every athlete wants to win,” he said in 2001.

Laura Hillenbrand, author of the best-selling book about him, “Unbroken: A World War II Story of Survival, Resilience, and Redemption,” said Thursday: “His wasn’t a sad story. It was a triumph. He left behind a lesson in the breadth of possibility for all of us, and in forgiveness.”

The book is being made into a movie directed by Angelina Jolie, scheduled for a December release by Universal. Actor Jack O’Connell portrays Mr. Zamperini.

Mr. Zamperini was born on Jan. 26, 1917, in Olean, in western New York. When he was 2, the family moved to Southern California, where he spent a rebellious childhood before channeling his energy and tenacity into sports. He started with boxing, to defend himself from bullies, but became a world-class runner after joining his high-school track team.

In 1934, Mr. Zamperini — nicknamed the “Torrance Tornado” for his hometown of Torrance, Calif. — broke the 18-year-old interscholastic record for the mile in 4:21.2, a mark that stood for 20 years.

A track star at the University of Southern California, he competed in the 5,000-meter run at the 1936 Berlin Olympics, where his roommate was Jesse Owens. Mr. Zamperini finished eighth but caught attention by running the final lap in 56 seconds — and grabbed headlines by stealing a Nazi flag.

But it was his World War II story that captured the imagination of millions back home.

He was a bombardier on a U.S. Army Air Forces bomber that crashed in the Pacific during a reconnaissance mission. He and another crew memberdrifted for 47 days on a raft, drinking rain water and eating fish and birds they caught with their hands, before being captured by Japanese forces. A third man died before they reached land.

“Forty-seven days in a raft, you learn the value of water more than anything in the world,” he told the AP in a 2003 interview. “We prayed for rain to have something to drink. When you’re hungry, you eat anything. We caught a shark. We caught an albatross that tasted like a hot-fudge sundae.”

When he and his raft-mate, pilot Russell Allen Phillips, reached land on the Marshall Islands, they were captured by the Japanese, who had strafed their raft from the air.

“I thought to myself, ‘Six weeks ago, I was a world-class athlete,’ ” he said. “And then, for the first time in my life, I cried.”

Mr. Zamperini spent more than two years as a prisoner of war being shuttled among Japanese prison camps, where he survived beatings, starvation, debilitating illnesses and psychological torture designed to break him down and make an example of the famous Olympian-turned-war hero.

After he was freed at the end of the war, he wrestled with rage, depression and alcoholism that almost cost him his marriage.

“Pain never bothered me,” he said in 2003. “Destroying my dignity stuck with me.”

After the war, he was told by an Army superior that his raft trip qualified him for $7.60 a day in reimbursement. But someone higher up in the command nixed it: “Request denied,” the letter said. “Travel unauthorized.”

Several years after his return, Mr. Zamperini attended a Billy Graham revival in Los Angeles and embraced Christianity.

Years later, he wrote a letter of forgiveness to one of his most horrific tormentors, a guard the other prisoners nicknamed “The Bird.”

In 1998, he went back to Japan to run a leg of the torch relay at the Nagano Olympics and ran past the former camps where he had been imprisoned.

“I figure the war took 10 years off my life,” Mr. Zamperini told the Los Angeles Times in 2002. “I decided to get those 10 years back.”

His wife, Cynthia Applewhite, whom he married in 1946, died in 2001. His survivors include a daughter, son and grandchildren.

Material from the Los Angeles Times is included in this report.