Legendary test and air-show pilot Bob Hoover in an undated photograph. (Bob Hoover Archives)

Bob Hoover, a World War II fighter pilot who escaped a POW camp and flew to freedom by stealing a German airplane and who spent decades testing aircraft, thrilling spectators at air shows and training military aviators, died Oct. 25 at a hospital in Torrance, Calif. He was 94.

The cause was congestive heart failure, said his daughter-in-law, Lynn Hoover.

Mr. Hoover, who learned to fly as a teenager in Tennessee, was among the country’s most revered pilots. The renowned World War II airman Gen. Jimmy Doolittle once called Mr. Hoover “the greatest stick-and-rudder man who ever lived.”

In 1947, Mr. Hoover was a test pilot flying alongside Chuck Yeager when Yeager broke the sound barrier. Mr. Hoover taught dive-bombing maneuvers to Air Force pilots during the Korean War.

He flew more than 300 varieties of airplanes and knew virtually every significant figure in the history of aviation, from Orville Wright to Charles Lindbergh to Neil Armstrong, the first astronaut to walk on the moon. During his decades as a stunt pilot, Mr. Hoover handled his plane so smoothly that he could pour a cup of tea while executing a ­360-degree roll. One of the airplanes he used for aerobatics, a North American Rockwell Shrike Commander 500S, is housed in the National Air and Space Museum’s Steven F. ­Udvar-Hazy Center in Chantilly, Va.

Bob Hoover at the National Air and Space Museum, where he received an award for lifetime achievement in 2007. (Marvin Joseph/The Washington Post)

“He had such an intuitive sense of how to fly an airplane,” Dorothy S. Cochrane, a curator at the Air and Space Museum, said in an interview. “He had a stunning ability to be a part of the airplane and to figure out what was wrong and how to get out of it and recover. He just had that ability not only to do it himself but to communicate to others.”

As recently as last year, actor Harrison Ford credited lessons learned from Mr. Hoover with helping him survive a crash landing of a vintage airplane on a California golf course.

During World War II, while based in North Africa and southern Europe, Mr. Hoover flew 58 missions as a fighter pilot with the Army Air Forces. On his 59th, on Feb. 9, 1944, he was shot down off the coast of southern France and was plucked from the sea by a German patrol boat.

He spent more than a year in a German prison camp before he and a fellow American climbed the fence and fled into the nearby woods. With the war coming to an end, German civilians were more cooperative, and a farm woman gave Mr. Hoover and his fellow escapee a gun.

“She said it would do us a lot more good than it did her, and she was right,” Mr. Hoover later told the Los Angeles Daily News.

He and his friend came upon a field with hundreds of damaged German warplanes. Mr. Hoover found one that had a full gas tank.

When a German mechanic approached, Mr. Hoover’s friend pulled the gun on him.

Hoover with Chuck Yeager, left, on the 50th anniversary of the historic flight that broke the sound barrier. (Reuters/Reuters)

“We told him unless he could get us airborne fast, we were going to kill him,” Mr. Hoover recalled years later.

The German plane’s engine started, but Mr. Hoover’s buddy refused to get aboard, vowing never to fly in another airplane. Instead, he took his chances on foot — and years later was reunited with Mr. Hoover.

The stolen plane had a German cross painted on the side, and Mr. Hoover was fearful of being attacked by Allied forces as he flew along the coast of Germany toward the Netherlands.

“I didn’t have any maps or charts,” he said in a 2007 interview with the publication Airport Journals. “I knew that if I turned west and followed the shoreline, I would be safe when I saw windmills.”

He landed in a field and was quickly surrounded by Dutch farmers with pitchforks. Soon afterward, a British army truck rolled up, and Mr. Hoover was taken to safety.

Hailed as a hero, he noted that the prison camps were loosely guarded during the waning days of the war. “People made it sound like a great escape,” he said, “but the guards had deserted us.”

Robert Anderson Hoover was born Jan. 24, 1922, in Nashville. His father was an office manager and bookkeeper.

Mr. Hoover began taking flying lessons at 15 and joined the Tennessee Air National Guard at 18.

After World War II, while serving in the newly formed Air Force, he was one of the test pilots selected for a project to break the sound barrier with the new Bell X-1 rocket-powered aircraft. When Yeager accomplished the feat in 1947, Mr. Hoover was flying the “chase plane” and took the first photographs of Yeager’s faster-than-sound flight.

He received the Distinguished Flying Cross, Purple Heart and other decorations before leaving the military in 1948. He then became a test pilot for General Motors, North American Aviation and North American Rockwell.

He lived for years in Palos Verdes Estates, Calif., and appeared at air shows around the world, flying a yellow P-51 Mustang or his white-and-green Shrike. In Moscow in 1966, he was briefly detained because he outshone Soviet pilots while flying a Russian-built plane.

In one of his most daring maneuvers, Mr. Hoover turned off the engines of his airplane and flew it like a glider, coming to a silent stop on the runway.

After a 1989 accident, in which his airplane was filled with the wrong fuel, Mr. Hoover invented a new kind of nozzle to prevent such mistakes from happening again.

His wife of 68 years, the former Colleen Humrickhouse, died in February. Survivors include two children, Anita Eley of Greeley, Colo., and Robert A. Hoover Jr. of El Segundo, Calif.; three grandchildren; and two great-grandsons.

In 1994, federal officials threatened to ground Mr. Hoover for failing medical tests. The outpouring from flying fans was so great that he was reexamined, and his pilot’s license was reinstated. He retired from aerobatics in his late 70s and piloted his last plane when he was 85.

Filmmaker Kim Furst premiered a documentary about Mr. Hoover, “Flying the Feathered Edge,” in 2014. Mr. Hoover published an autobiography, “Forever Flying,” in 1996.

In his book, Mr. Hoover wrote, “Hell, I would fly an old Dodge truck if they put wings on the side.”