HANOI — Little remains downtown of the prison known as Hoa Lo, a name loosely translated as “hell hole.”

Most of the French colonial-era complex was razed to make way for a luxury apartment high rise. The Vietnamese government turned what was left into a museum exhibiting a few of the dank cells where Vietnamese revolutionaries were held and sometimes executed by the French in the mid-20th century.

There is one small room near the back devoted to a different group of inmates who languished for years: American prisoners of the Vietnam War.

To those POWs this was the Hanoi Hilton, a nickname that oozed irony and defiance, the kind of petty “thumb in your eye” that provided some small pride in a place designed to strip dignity away.

Forty years ago on Feb. 12, the first of those long-held POWs were released as part of the Paris Peace Accords that ended America’s decadelong war with Vietnam.

They boarded a waiting plane and landed free men at Clark Air Base in the Philippines. They flew on to Hawaii, then to their families at home.

“Forty years later as I look back on that experience, believe it or not, I have somewhat mixed emotions in that it was a very difficult period,” said Sen. John McCain, shot down and captured in 1967. “But at the same time the bonds of friendship and love for my fellow prisoners will be the most enduring memory of my five and half years of incarceration.”

The POW experience at Hoa Lo — and in the archipelago of other prison camps in North Vietnam — was unlike anything American prisoners had encountered before or since.

POWs had faced brutality before in camps during World War II and the Korean War, but America’s involvement in those wars was relatively short compared with the Vietnam War. Few GIs have been taken prisoner in Afghanistan — despite the war’s length.

“We had only the slightest inkling that the Age of Aquarius had happened in this country,” said David Gray, an Air Force fighter pilot shot down and captured in January 1967. “We didn’t have an appreciation for how widespread and pervasive the antiwar sentiment had become.”

Indeed, the longest-held prisoner at Hoa Lo, Navy pilot Everett Alvarez, was shot down and captured in August 1964, a few months after the Beatles first toured America. His release in February 1973 came three years after the breakup of the band that defined that era’s youth culture.

If POWs were unaware of what was happening in the U.S., Americans remained mindful of them. A student group in California created silver POW bracelets in 1970, asking Americans to wear them until POWs returned home. Millions were sold.

“There was a sense of unity, togetherness, shared adversity,” said Gerald Coffee, a Navy aviator who was imprisoned for seven years and was among the first group released. “We came home and our release kind of symbolized the end of a very painful chapter in our nation’s history.

“We got the homecoming that every Vietnam War veteran should have had when he or she came home. We didn’t take that for granted.”

Named Operation Homecoming, the series of releases returned 591 POWs to freedom.

The Hoa Lo POW exhibit doesn’t provide many hints as to what prisoners such as Gray and Coffee experienced during those years. Much of it is given over to chiding the U.S. for aligning itself with the government of South Vietnam and its aerial bombardment of North Vietnam from 1965 to 1968 and then again in late 1972. McCain’s flight suit hangs eerily behind a glass case, along with the parachute that saved him.

The thing is, it’s not real. “Of course it’s not, of course it’s not,” said McCain when asked about it. “They cut my flight suit off of me when I was taken into the prison … The ‘museum’ is an excellent propaganda establishment with very little connection with the actual events that took place inside those walls.” He’s visited the museum a number of times for the sake of normalizing relations between the two countries, he said.

McCain said he has “great respect and affection for the Vietnamese people,” but added with an acid laugh that “there are individuals who are still around Hanoi that I would, umm, look forward to seeing again on a level playing field.

“It wasn’t so much for what they did to me but what they did to some of my fellow prisoners who did not return with us.”

Behind another case is what are claimed to be belongings of downed Navy pilot Everett Alvarez, which include a pack of Winston cigarettes and box of Vicks cough drops. Prominent is what’s labeled a “begging flag,” which is a multi-language message printed on cloth and used by downed U.S. pilots to ask assistance from locals.

Nothing here captures what Gray described as “23 hours of boredom a day and one hour of terror.”

Gray, who is 71 and lives in Fort Walton Beach, Fla., was on only his fourth mission over Hanoi when he was shot down. He fractured vertebrae and cut his face upon ejecting. Farmers quickly took him prisoner.

He was taken to Hoa Lo, where he was interrogated and tortured, sometimes by having his arms tied behind his back and then hoisted into the air. Mostly his interrogators wanted to know about upcoming planned missions.

“You make up stories as you go,” Gray said in a matter-of-fact style of the torture sessions. “That’s an unfortunate part about breaking in an interrogation. If you lie, they’re going to ask you again and again and again. You have to remember what you said. And there were a bunch of us who screwed up and somehow managed to stupidly change our stories.

“Before you come to the realization that it’s important to remember your lies, which happens about the second time they catch you …” Gray left the thought unfinished.

“The thing you learn about torture, particularly if you’re not tortured to incapacitation and death, the kind of very painful torture that we went through, it leaves a mark on you and you find that over time, emotionally, the fear of torture gets worse than torture.”

He remained isolated initially, but by the fifth or sixth day he made contact with another GI by talking under the door.

“Until then you think of yourself as some kind of traitor because they’ve bested you physically,” he said. But by talking to the others “you get brought into the game of trying to frustrate” the guards as much as possible. “It’s the only combativeness allowed to us in that circumstance. As different people I shared a cell with pointed out, you do things like that for the lack of anything better to do. If they want something, then you don’t want them to have it.”

He would soon be taught the “tap code” for communicating through walls.

Over the next six years he would live in camps nicknamed New Guy Village, Little Vegas, Faith, Hope, Dogpatch, Dirty Bird and Trolly Tracks.

“They tried initially to keep people in solitary, but they got so many of us that they couldn’t do that,” he said. “Cellmates are a godsend. You’d share every tidbit of knowledge your cellmates had.”

They passed the time by describing in detail books they read and movies they had watched.

After U.S. forces raided Son Tay camp in an attempt to rescue POWs, the Vietnamese moved many prisoners in outlying camps into Hoa Lo. That benefited the POWs because they were able to more easily socialize.

Gray said that he, like many others, never thought they’d be held in prison for so long.

“A thought widely shared by a lot of the American POWs was six months to a year,” he said. “Your mind does that to you. It forces you into some kind of overly optimistic state.”

That sense of optimism didn’t just help them survive imprisonment. It is likely what helped some of the released prisoners leave such extreme trauma behind them and live productive lives, according to the findings of a study published last year in the Journal of Traumatic Stress by the Robert E. Mitchell Center for Prisoner of War Studies in Pensacola, Fla.

The center has evaluated more than 400 of the Vietnam POWs since their release.

“By knowing them and having them as patients coming up on 40 years now, what we can do is focus on the type of person who had the experience,” said Dr. Jeffrey L. Moore, the center’s director and a co-author of the study.

“The results indicate that among this group, it was not merely the type of trauma that occurred which explained how one fared afterwards, but in addition, what type of person who experienced the trauma,” the study concluded.

Optimism was, in fact, a stronger predictor of resilience than the level of trauma, such as type and severity of torture, a prisoner received, the study found.

Gray said that he and many others were highly attuned to optimistic “signs” that release was somewhat near, whether that was an increase in the quantity and quality of food, more frequent visits by a dentist or doctor, or more humane treatment in general.

In early 1973, the search for signs ended.

One day in January they were ushered out of their cells at Hoa Lo and ordered to stand in two long lines. A movie camera was off to the side, but not hidden so well that the men weren’t aware of it, Gray said.

The peace accords required that a notice of their imminent release be read to the men.

“And so we just wandered away. We ruined their evening news shot.” It was part of POW code of behavior years in the making.

Coffee recalled a celebratory atmosphere the night he and about 60 others were scheduled for release the next day.

The next day he boarded a C-141 plane and was greeted by a crew that included “four beautiful Air Force nurses,” he said.

“The pilot cranked up the engines and taxied out to the end of the runway. It really got quiet because we were all sitting there thinking, God, is this really going to be it? Are we really going home? Am I dreaming?”

The plane rattled down the rough runway, arched into the sky and smoothed out.

“The pilot came on and said, ‘Congratulations, men, we just left North Vietnam.’ And that’s when we cheered. That’s when we believed it.”

Gray’s release came a few weeks later in March. He was led to the open rear-cargo door of another C-141 plane.

“Alongside the ramp is a medical orderly wearing whites,” Gray recalled. “He’s asking, ‘Who are you?’ When he gets to me, I say, Captain Gray — because I knew I was a captain by then.