Jeremiah Andrew Denton Jr., who spent 7½ years as a prisoner of war in Vietnam and later won election to the U.S. Senate from Alabama, died Friday. He was 89.

Denton, who served in the Senate from 1981 to 1987, was Alabama’s first Republican senator since Reconstruction.

He gained attention in the Senate for his blunt speech and focus on social issues such as sex outside of marriage and his belief that a breakdown of the family endangered America.

Denton in the Senate strongly supported then-President Ronald Reagan and Reagan’s buildup of weapons such as the MX missile and development of a space-based ‘‘Star Wars’’ anti-missile shield.

But Denton in an interview in November 2005 said he likely would be best remembered for two events, one when he was a prisoner of war in 1965-1973 and one that happened just after his release from North Vietnam in February 1973.

Denton, who served more than three decades in the Navy and retired in 1977 as a rear admiral, was shot down in July 1965 while flying an A-6 Intruder attack plane on a bombing mission about 75 miles south of Hanoi.

Denton, a Navy commander when he was shot down, endured years of torture and solitary confinement while imprisoned in or near Hanoi. He often tried to organize resistance by his fellow POWs as one of the senior captured U.S. officers.

During a TV interview arranged by the North Vietnamese in May 1966, Denton blinked his eyes in Morse code, repeatedly spelling the word T-O-R-T-U-R-E.

Denton in that TV interview also said he didn’t know what was happening in the war because he only had access to North Vietnamese media, but that ‘‘whatever the position of my government is, I agree with it, I support it and I will support it as long as I live.’’ The interview was broadcast in America later that month.

In his book detailing his POW experience, ‘‘When Hell was in Session,’’ Denton wrote that naval intelligence officials picked up his Morse code message.

‘‘It was the first clear message U.S. intelligence had received that we were being tortured,’’ Denton said in his 1976 book, which he wrote with Ed Brandt.

Denton in his book said he paid in blood a few days later for that and similar interviews, saying he was beaten, shackled and tortured. A TV movie based on ‘‘When Hell was in Session’’ aired in 1979, starring Hal Holbrook as Denton.

Denton gained more fame Feb. 12, 1973, when he spoke on TV on behalf of the first group of American POWs released from North Vietnam and flown to Clark Air Force Base in the Philippines.

After he stepped from the C-141 jet transport, Denton said, ‘‘We are honored to have had the opportunity to serve our country under difficult circumstances. We are profoundly grateful to our commander-in-chief and to our nation for this day. God bless America.’’

Reagan in his State of the Union address in 1982 recalled Denton’s actions and words that day and called Denton a hero. ‘‘We don’t have to turn to our history books for heroes,’’ Reagan said in his speech to Congress. ‘‘They are all around us. One who sits among you here tonight epitomized that heroism. . . .’’

Asked in November 2005 about those two events in 1966 and 1973, Denton said, ‘‘That’s what I am remembered by.’’

‘‘I can’t think of anything I did more notable,’’ he said, except marrying his wife, the former Kathryn Jane Maury of Mobile, in June 1946, and having seven ‘‘great’’ children with her.

Denton said he and his wife in 2007 moved from near Mobile to Williamsburg, Va., to be closer to some of their children. Mrs. Denton died Nov. 22, 2007. She was 81.

Denton was born in Mobile on July 15, 1924. His mother and father separated in 1936 and divorced in 1938. He said that experience was one reason why he emphasized the importance of the family.

‘‘He didn’t send mother much money for us,’’ Denton said in an interview. ‘‘It was a terrible experience for me and my brothers, who were younger than I, to go through.’’

Denton attended Spring Hill College in Mobile in 1942-43 and graduated from the U.S. Naval Academy in 1946. He earned a master’s degree in international affairs from George Washington University in 1964.

Asked about the Vietnam War, Denton in interviews in 1990 and 2005 said he believed America could have won a quick military victory in Vietnam if President Johnson in 1965 had used just a fraction of the power that President Nixon used in December 1972 to bomb Hanoi and Haiphong in massive B-52 raids.

‘‘It would have been over. The cause was right,’’ Denton said. South Vietnam fell to communist North Vietnam in 1975 soon after Congress cut all military aid to the South. ‘‘After winning the victory, Congress gave it back after the fact by cutting off all aid (to South Vietnam),’’ Denton said.

Denton said Vietnam was ‘‘a just cause,’’ proven by the mass murders of millions of people that followed in neighboring Cambodia and the purges conducted by communists after the fall of South Vietnam.

Denton, a devout Catholic, said he was disgusted by the massage parlors and X-rated theaters that he saw in 1973 upon returning to America after seven and a half as a POW.

After retiring from the Navy, Denton formed the non-profit group Coalition For Decency to promote traditional family values. He said he also was a consultant to the Christian Broadcasting Network and as an assistant to the president of Spring Hill College.

Denton in his race for the U.S. Senate in 1980 warned of the threat of nuclear attack by the Soviet Union and urged a U.S. military buildup. He defeated former U.S. Rep. Armistead Selden in the Republican primary and beat Democrat Jim Folsom Jr., who was then a Public Service Commission member, in the general election.

Denton in the Senate opposed abortion and supported organized prayer in public schools, tax cuts proposed by Reagan and tax credits for private school tuition. The National Journal said Denton was the Senate’s most conservative member in 1982.

His sometimes-salty language generated headlines.

For instance, Denton in November 1981 tried but failed to persuade the Senate Judiciary Committee not to allow a wife to charge her husband with rape under federal criminal law. ‘‘Dammit, when you get married, you kind of expect you’re going to get a little sex,’’ Denton said. He later said a wife abused by her husband could file a charge of assault or battery.

In the Senate, Denton sponsored and helped push into law a federal program to discourage teenagers from having sex outside of marriage. He also was a prime sponsor of a law that said public schools that got federal money must let student religious groups have the same access to school facilities outside of class as other student groups.

Denton sponsored a law that allowed Southeast Asian children fathered by Americans to emigrate to the United States. He also sponsored the Denton Program, which since 1985 has let charities send farm equipment, medical supplies and other aid overseas for free on U.S. military planes and ships, when they had space.

Denton in the Senate argued that sexual immorality was undermining the American family, and said that erosion hurt America’s productivity and competitiveness.

Denton in a 1990 interview said he believed America was declining as a superpower because the American people were turning away from Judeo-Christian principles that he said made this country great. ‘‘The only time you see a G movie is when it’s about a damn animal,’’ he said.

Denton in 1986 lost his bid for re-election to the Senate, losing by fewer than 7,000 votes to then-Democratic U.S. Rep. Richard Shelby.

Denton’s reluctance while in office to travel back to Alabama to hold town-hall meetings and shake hands may have cost him the election, former U.S. Rep. Bill Dickinson, R-Montgomery, said in a 2005 interview.

‘‘He didn’t do the traditional things politicians are expected to do, working the crowd, kissing babies, so to speak,’’ Dickinson said. ‘‘I think he felt that was sort of beneath him as a senator. If he didn’t want to do something, he just didn’t do it. He was different. But I think he was a real American hero.’’

‘‘Denton’s high point was while he was in the service as a POW in Vietnam, and the leadership he offered while a POW,’’ Dickinson said.

Denton kept a hand in politics after he left the Senate.

For instance, in October 1996 he campaigned in then-Attorney General Jeff Sessions’ successful run for the Senate, and spoke at a Montgomery rally for Republican presidential candidate Bob Dole.

Denton in October 1998 endorsed then-Gov. Fob James for another term, saying James understood and acted on principles that ‘‘have made this country great.’’

In May 2000, Denton endorsed Roy More for Alabama chief justice, describing Moore as a beacon in a godless society.

And in July 2003, Denton and other Republicans describing themselves as R.E.A.L., Republicans for Education, Accountability and Leadership, backed a plan by Gov. Bob Riley that would have raised state and local taxes by $1.2 billion a year, if voters approved. Riley said the tax plan would have financed improvements to help Alabama’s public schools provide ‘‘world-class’’ education. Voters rejected the plan in September 2003.

Former U.S. Rep. Ronnie Flippo, D-Florence, in a 2005 interview said, ‘‘I always felt that Sen. Denton was a man of strong and positive convictions.’’

‘‘His service in the military is the thing no one can ever forget or should forget,’’ Flippo said.

Denton in a 2005 interview said he wanted to be remembered as, ‘‘a guy who really did his best for God’s will being done on earth.’’

This obituary was written by former Birmingham News and AL.com staff writer David White.