Warren B. Rudman, who warned against soaring federal deficits as a pugnacious two-term senator from New Hampshire and who became the strongest Republican critic of the Reagan administration during the Iran-contra affair of the 1980s, died Nov. 19 at George Washington University Hospital. He was 82.

He had complications from lymphoma, said Bob Stevenson, his former communications director .

Mr. Rudman, an Army combat veteran of the Korean War and former New Hampshire attorney general, was first elected to Congress in 1980 and became known as the straight-talking ethical conscience of the Senate. His nickname, according to Senate colleagues, was “Sledgehammer.”

After not seeking reelection in 1992, Mr. Rudman remained a presence in Washington as a member of several blue-ribbon panels investigating terrorism and financial irregularities. In February 2001, seven months before the Sept. 11 attacks, a panel led by Mr. Rudman and former senator Gary Hart (D-Colo.) warned of a probable terrorist strike on U.S. soil within 25 years. The panel called for the creation of a “homeland security agency,” which occurred in 2002.

During his first years in the Senate, Mr. Rudman was a reliable supporter of the policies of President Ronald Reagan, a fellow Republican. But the senator soon began to exhibit an independent streak not limited by partisan loyalty.

He was a sponsor of the landmark budget-cutting legislation known as the Gramm-Rudman-Hollings Act. He grilled Oliver L. North and other Reagan administration operatives involved in the Iran-contra arms-for-hostages deal, questioned fellow senators involved in the Keating Five savings-and-loan scandal, and successfully promoted the nomination of his New Hampshire protege, David H. Souter, to the Supreme Court in 1990.

“In two terms, he had as great an impact as any senator that I’ve known,” former senator William S. Cohen (R-Maine), a colleague who later served as defense secretary in the Clinton administration, said in an interview. “That was by the force of his intellect and the force of his personality.”

Mr. Rudman was among the first members of Congress to speak out about the rising federal debt, which he believed was a threat to bankrupt the country. Alarmed by an annual deficit that had reached a record $200 billion in 1985 under Reagan — the annual figure now exceeds $1 trillion — Mr. Rudman joined Sens. Phil Gramm (R-Tex.) and Ernest F. Hollings (D-S.C.) as principal sponsors of the ­Gramm-Rudman-Hollings Balanced Budg­et Act of 1985.

The act, often shortened to Gramm-Rudman, called for a balanced federal budget within six years and was the first substantive effort by Congress in modern times to compel reductions in the federal deficit.

Under Gramm-Rudman, automatic budget cuts — called sequestrations — would be imposed by the U.S. comptroller general if certain spending limits were not met. The bill drew howls of protest across the political landscape, from social liberals to defense hawks.

Even Mr. Rudman was lukewarm about Gramm-Rudman, piquantly calling it “a bad idea whose time has come.”

The bill passed by a two-thirds majority and was signed by Reagan. In 1986, Gramm-Rudman was struck down by the Supreme Court on the grounds that it violated the separation-of-powers doctrine of the Constitution. (The court ruled that the comptroller general, who was appointed by Congress, would have assumed executive powers in his role as designated budget cutter.)

An amended version of Gramm-Rudman was passed in 1987 and signed by Reagan. It was replaced by another bill in 1990 but, nonetheless, was considered a major step in drawing attention to the rising federal debt and the growing cost of entitlement programs. It also introduced the term sequestration, which has been adopted by later generations of congressional budget-watchers.

“It set a precedent for draconian budget cuts when all else failed,” Ross K. Baker, a Rutgers University political science professor and an authority on congressional politics, said in an interview.

Throughout his Senate career, the combative Mr. Rudman had a knack for seeing through the veil of Washington rhetoric.

When Reagan’s defense secretary, Caspar W. Weinberger, said in a 1983 Senate hearing that the United States should plan for a “protracted” nuclear war, Mr. Rudman called the idea “asinine.”

“Anybody who talks about protracted nuclear war has never heard a shot fired in anger,” said Mr. Rudman, who spent 15 months in combat as a company commander during the Korean War and was awarded the Bronze Star Medal.

A lone wolf who was wary of the capital’s rituals, Mr. Rudman refused to wear a tuxedo under any circumstances and repeatedly turned down invitations to the White House.

“Quite frankly this is not a town that cares for Warren Rudman as a person, or for anything I value,” he told The Washington Post in 1986. “If the word ‘senator’ disappeared from in front of my name, my invitations would go from 200 a week to two a year.”

Mr. Rudman gained his greatest public renown during the televised hearings in 1987 on the Iran-contra matter. He was vice chairman of a joint House-Senate committee investigating the Reagan administration’s secret deals to sell arms to Iran in exchange for U.S. hostages. Money from the arms sales was then diverted to rebels, known as the contras, fighting the Marxist Sandinista regime in Nicaragua.

Turning against his own party, Mr. Rudman called on Reagan to apologize to the American people for what he called “an act of folly.”

“He was one of a vanishing breed of Northeastern moderate Republicans, people who almost gleefully defy orthodoxy when a principle is involved,” Baker said.

During the hearings, Mr. Rudman reprimanded North, a Marine Corps lieutenant colonel who oversaw the operation from the White House. Mr. Rudman considered North a renegade leading a rogue foreign policy operation that ultimately sent more than $30 million to the contras.

North was convicted on three counts, but the convictions were overturned. When it was revealed during the hearings that North had cashed travelers checks intended for the contras and had purchased, among other things, snow tires, Mr. Rudman sarcastically asked contra leader Adolfo Calero, “When was the last time it snowed in Nicaragua?”

Warren Bruce Rudman was born May 18, 1930, in Boston and grew up in Nashua, N.H., where his family had a furniture-manufacturing business. He said he learned to box in his youth as a response to anti-Semitic taunts. He was a boxer at New York’s Syracuse University, from which he graduated in 1952.

He received a law degree from Boston College in 1960 and practiced law in Nashua before being appointed attorney general of New Hampshire in 1970. His deputy attorney general was Souter, whose nomination to the Supreme Court was championed by Mr. Rudman.

In his 1996 memoir, “Combat: Twelve Years in the U.S. Senate,” Mr. Rudman wrote that he had a five-hour conversation with Souter to persuade him to go through with the rigorous nomination process.

“It’s your destiny to serve on the Supreme Court,” Mr. Rudman said he told Souter, who was confirmed by the Senate, 90 to 9. Souter retired in 2010.

As a member of the Senate Ethics Committee in 1990, Mr. Rudman participated in the televised investigation of the Keating Five — five of his fellow senators who were accused of seeking special favors for Charles H. Keating Jr., the leader of a troubled savings-and-loan in Arizona, who had contributed to their campaigns.

In the hearings, Mr. Rudman questioned the senators — Alan Cranston (D-Calif.), Dennis DeConcini (D-Ariz.), John Glenn (D-Ohio), John McCain (R-Ariz.) and Donald W. Riegle Jr. (D-Mich.). In the end, the Senate censured Cranston and reprimanded the others for “poor judgment.’’

Mr. Rudman did not seek reelection in 1992, writing in his memoir, “I could see the Republican Party gradually being taken over by ‘movement’ conservatives and self-commissioned Christian soldiers whose social agenda I found repugnant.”

His wife of 57 years, Shirley Wahl Rudman, died in 2010. A son, Alan Rudman, died in 2004.

Survivors include his wife since 2011, Margaret Shean Rudman of Washington; two daughters from his first marriage, Laura Rudman Robie of Amherst, N.H., and Debra Gilmore of Wayland, Mass.; two sisters, Jean Gale of Cape Neddick, Maine, and Carol Rudman of Washington; and three grandchildren.

After serving in the Senate, Mr. Rudman practiced law and, with former senator Paul Tsongas (D-Mass.) and former commerce secretary Peter Peterson, co-founded the Concord Coalition, an organization promoting fiscal responsibility.

At the time of his death, he was a principal of the Albright Stonebridge Group, an international consulting firm whose leaders include former secretary of state Madeleine K. Albright and former national security adviser Samuel R. Berger.

When Mr. Rudman graduated from Syracuse in 1952, he was denied his diploma because he would not pay an $18 fee for the college yearbook. He claimed that purchasing the yearbook should not be a requirement for a diploma.

It became a matter of stubborn principle, and for years Mr. Rudman always rooted against Syracuse in sports contests. When he was elected to the Senate in 1980, Syracuse finally sent him the diploma, but by then it was too late: Mr. Rudman refused to accept it.