Correction: An earlier version of this obituary incorrectly reported the name of Mary Denton Lewis, Adm. Denton’s daughter. Also, he had eight great-grandchildren, not six. The obituary has been corrected.

Jeremiah A. Denton Jr., a retired Navy rear admiral and former U.S. senator who survived nearly eight years of captivity in North Vietnamese prisons, and whose public acts of defiance and patriotism came to embody the sacrifices of American POWs in Vietnam, died March 28 at a hospice in Virginia Beach. He was 89.

The cause was complications from a heart ailment, said his son Jim Denton. Adm. Denton was a native of Alabama, where in 1980 he became the state’s first Republican to win election to the Senate since Reconstruction.

Adm. Denton lost a reelection bid six years later. But he remained widely known for his heroism as a naval aviator and prisoner of war, and particularly for two television appearances that reached millions of Americans through the evening news during the Vietnam War.

In the first, orchestrated by the North Vietnamese as propaganda and broadcast in the United States in 1966, he appeared in his prison uniform and blinked the word “torture” in Morse code — a secret message to U.S. military intelligence for which he later received the Navy Cross.

In the second television appearance, during Operation Homecoming in 1973, he became the first freed POW to step off a plane at a U.S. air base in the Philippines. He spoke through tears before cameras, expressing his gratitude for having had the opportunity to serve his country under “difficult circumstances.”

Adm. Jeremiah A. Denton Jr., an American prisoner of the North Vietnamese, is shown here during a 1966 recorded interview in which he blinked the word “torture” in Morse code. (AP)

Adm. Denton was shot down south of Hanoi on July 18, 1965, about a month after his deployment to Southeast Asia. A former test pilot — and the father of seven — he was a commander at the time and was flying an A-6 Intruder on a bombing mission near the Thanh Hoa Bridge. When his plane came under antiaircraft attack and fell into a tailspin, he ejected and was captured.

Over the next seven years and seven months, Adm. Denton was incarcerated in prisons including the infamous Hoa Lo complex, also known as the Hanoi Hilton, and the facility dubbed “Alcatraz” that was reserved for the most willful resisters. Also at Alcatraz were James B. Stockdale, the future vice presidential running mate of Ross Perot, and Sam Johnson, a future Republican congressman from Texas.

Adm. Denton was subjected to four years in solitary confinement. Living in roach- and rat-infested conditions, he endured starvation, delirium and torture sessions that sometimes lasted days.

In one such session, his captors placed across his shins a nine-foot-long, cement-filled iron bar, he recalled in his memoir, “When Hell Was in Session,” written with Ed Brandt.

One torturer “stood on it, and he and the other guard took turns jumping up and down and rolling it across my legs,” Adm. Denton wrote. “Then they lifted my arms behind my back by the cuffs, raising the top part of my body off the floor and dragging me around and around. This went on for hours.

“They were in a frenzy,” he continued, “alternating the treatment to increase the pain until I was unable to control myself. I began crying hysterically, blood and tears mingling and running down my cheeks. . . . My only thought was a desire to be free of pain.”

Ten months into his imprisonment, Adm. Denton was ordered to submit to an interview with a Japanese reporter. He said the North Vietnamese tortured him before the meeting in an effort to compel him to assist with their communist propaganda.

In the footage, Adm. Denton walks through a doorway, bows and then, with evident discomfort, takes his seat in a chair. Hunched over, he clasps his hands between his knees. Looking into the camera lights as he speaks, he blinks his eyes hard and repeatedly, in a manner that to an untrained observer might have seemed involuntary — and that in Morse code spelled t-o-r-t-u-r-e.

Adm. Denton later said that while the blinking drew more attention, the words he spoke to the interviewer required greater courage. At one point, the reporter asked him what he thought about the “so-called Vietnamese War.”

“Well, I don’t know what is happening,” Adm. Denton replied. “But whatever the position of my government is, I support it fully. . . . I am a member of that government, and it is my job to support it, and I will as long as I live.”

Another torture session followed.

Adm. Denton was among the highest-ranking officers to be taken prisoner in Vietnam and retained his full sense of responsibility toward his men. “I put out the policy that they were not to succumb to threats, but must stand up and say no,” he told the New York Times. “We forced them to be brutal to us.”

In his memoir, Adm. Denton recalled devising a communication system for the inmates involving coughs, sniffs and sneezes. Such noises, because of the men’s poor health, was not readily discerned by the North Vietnamese and allowed the POWs to maintain a spirit-sustaining sense of community.

On Feb. 12, 1973, shortly after the signing of the Paris Peace Accords that helped end U.S. involvement in the war, Adm. Denton and hundreds of other POWs began coming home. By virtue of his rank and length of imprisonment, he was the first returnee to disembark from the plane at Clark Air Base in the Philippines.

“We are profoundly grateful to our commander in chief and to our nation for this day,” he said in a speech on behalf of his fellow POWs. “God bless America.”

Jeremiah Andrew Denton Jr. was born on July 15, 1924, in Mobile, Ala. He attended more than a dozen grammar schools and lived in hotel rooms as his family followed his father’s jobs in the hospitality industry. His parents later divorced, and he credited his mother with instilling in him a deep Catholic faith.

Adm. Denton said that he became interested in the Navy after watching “Navy Blue and Gold,” the 1937 film starring James Stewart, Robert Young and Lionel Barrymore. He graduated from the U.S. Naval Academy at Annapolis in 1946 and received a master’s degree in international affairs from George Washington University in 1964.

He was promoted during his captivity to the rank of captain and later to rear admiral. After the war, he served as commandant of the Armed Forces Staff College at Norfolk, Va., and retired from the Navy in 1977.

In addition to the Navy Cross, his honors included the Defense Distinguished Service Medal, three awards of the Silver Star and the Distinguished Flying Cross. He was portrayed by actor Hal Holbrook in a 1979 made-for-TV movie adaptation of his memoir that also featured Eva Marie Saint as his wife.

Many things changed in the United States during Adm. Denton’s long absence. His children, who ranged in age from 18 months to 18 years when he left for Vietnam, grew up. Two of his sons were married. Martin Luther King Jr. and Robert F. Kennedy were assassinated. Astronaut Neil Armstrong walked on the moon. And American culture, in Adm. Denton’s view, became far too permissive.

After his military retirement, he created a group called the Coalition for Decency. With backing from evangelist Jerry Falwell’s Moral Majority, he defeated Democrat Jim Folsom Jr. to win election to the Senate.

In Washington, Adm. Denton was most outspoken on issues related to the preservation of the nuclear family, a goal that he sought to pursue through a $30 million bill to push chastity among teenagers.

“No nation can survive long,” he said, “unless it can encourage its young to withhold indulgence in their sexual appetites until marriage.”

Adm. Denton also chaired a subcommittee on internal security and terrorism, which focused on communist and Soviet threats. By the mid-1980s, he told Time magazine at the outset of the decade, “We will have less national security than we had proportionately when George Washington’s troops were walking around barefoot at Valley Forge.”

In 1986, Adm. Denton lost his seat to then-U.S. Rep. Richard C. Shelby, who at the time was a Democrat and later became a Republican. Adm. Denton remained active in public affairs, however, and spoke frequently on his experience in Vietnam and his political convictions.

His wife of 61 years, Jane Maury Denton, died in 2007. Survivors include his wife of three years, Mary Belle Bordone of Virginia Beach; seven children from his first marriage, Jerry Denton and Bill Denton, both of Virginia Beach, Don Denton of Haverford, Pa., Jim Denton of Washington, Madeleine Doak of The Woodlands, Tex., Michael Denton of Richmond, Va., and Mary Denton Lewis of Atlanta; a brother; 14 grandchildren; and eight great-grandchildren.

Adm. Denton once reflected on his survival in North Vietnam.

“If I had known when I was shot down that I would be there more than seven years, I would have died of despondency, of despair,” he told Investor’s Business Daily. “But I didn’t. It was one minute at a time, one hour, one week, one year and so on. If you look at it like that, anybody can do anything.”