Rep. Barney Frank, a Democrat from Massachusetts, announced his retirement at a news conference at city hall in Newton, Mass. on Nov. 28, 2011. (Kelvin Ma/BLOOMBERG)

Love him or hate him — and there are few who fall anywhere in between — Rep. Barney Frank has spent the past three decades crafting one of Congress’s most pugnacious political personalities, which he has deployed frequently as a weapon in the ideological wars of the age.

On the left, the Massachusetts Democrat has been a hero for his effort to rein in the nation’s largest banks and for his role in promoting gay rights, having been the most prominent openly gay member of Congress. On the right, Frank became a stand-in, alongside Rep. Nancy Pelosi (D-Calif.) and the late senator Edward M. Kennedy (D-Mass.), for attack lines designed to gin up conservative activists.

Behind the scenes, however, Frank — who was first elected in 1980 — became one of the most important lawmakers of his generation, a successful backroom negotiator who knew how to broker critical deals. With his announcement Monday that he will not seek reelection next year, he will leave a legacy that goes beyond simple politics.

Few lawmakers can claim, as Frank can, to have won the trust of both the George W. Bush Treasury Department and the gay rights movement.

“This country has never had a Congressman like Barney Frank, and the House of Representatives will not be the same without him,” President Obama said in a statement.

Frank’s influence, unusual in this day for a lawmaker who never aspired to party leadership or the presidency, has been on display throughout the 2012 GOP presidential campaign. His longtime nemesis, former House speaker Newt Gingrich (Ga.), has risen steadily in public polling ever since he suggested in a mid-October debate that Frank should be “thrown in jail” for his influence in pushing the Clinton and Bush administrations to promote homeownership and then in his oversight of the housing industry.

Never one to hold his fire, Frank, 71, hit back over the past few weeks, calling Gingrich a “liar,” citing his seven-figure salary as a consultant for Freddie Mac. “I did not think I lived a good enough life to see Newt Gingrich as the Republican nominee,” Frank said Monday at a news conference in Newton, Mass. “He would be the best thing to happen to Democrats since Barry Goldwater.”

In his Monday announcement, Frank said that, after serving more than 30 years, he does not have the energy to run for reelection in a newly drawn congressional district. Although the district still favors Democrats, half the voters would be new to Frank, requiring a vigorous campaign.

“I don’t have to pretend to be nice to people I don’t like,” he told reporters in his vintage half-joking style.

In 2007, Frank became chairman of the House Financial Services Committee and for the next four years, oversaw Wall Street, housing and the multitude of financial firms that packaged questionable mortgages into complicated trading mechanisms. This placed him at the epicenter of the most critical debates of this era, beginning with housing legislation in 2007 and 2008 that tried to forestall the industry’s collapse. In the fall of 2008, Frank was the lead House Democratic negotiator for what became the $700 billion bailout of Wall Street, alongside then-Sen. Christopher J. Dodd (D-Conn.).

Frank — an openly gay, Jewish liberal representing a district south of Boston — developed a deep bond with then-Treasury Secretary Henry M. Paulson — a Christian Eagle Scout raised in Illinois who went on to run Goldman Sachs.

“Two elements made it possible for Hank Paulson and me to work together despite partisan anger about our cooperation,” Frank wrote in the foreword to the paperback edition of Paulson’s book, “On the Brink.” “First, we trusted each other, admired each other’s integrity and commitment to the public good, and shared a similar and natural understanding of the crisis that faced us, and we were helped by the fact that we were both in power.”

By late 2009, Frank and Dodd began deep, protracted negotiations on legislation that came to bear their names: a rewrite of Wall Street oversight. The Dodd-Frank legislation tried to create a more transparent financial services industry, requiring more disclosure of exotic derivative trades and creating the Consumer Financial Protection Bureau.

Wall Street firms, feeling abandoned by Frank and other Democrats who they thought were their allies, have fought some pieces of Dodd-Frank. Senate Republicans have vowed to block any appointment by Obama to the consumer protection bureau.

Frank’s departure will set off a scramble for the top Democratic slot on the Financial Services Committee. Next in line is Rep. Maxine Waters (D-Calif.), but she is under investigation by the ethics committee over her office’s role in helping a bank receive bailout money while her husband was a major investor in the company.

Other Democrats who could get the top slot include Reps. Carolyn B. Maloney (N.Y.), Luis V. Guitierrez (Ill.) and Nydia M. Velazquez (N.Y.).

Despite his partisan profile, Frank often has worked out imperfect compromises that slowly but surely have advanced his cause, whether they were over Wall Street regulation or gay rights.

In 1990, Frank was reprimanded during an investigation of allegations involving his relationship with a male prostitute who worked out of the lawmaker’s Capitol Hill townhouse. The panel found that Frank had no knowledge of the illegal activities, but it disciplined him for using his office to help take care of traffic tickets for his partner.

The lawmaker’s wit has made him one of the legendary sparring contenders for House floor debates and a sought-after personality in the age of cable television. However, in what in retrospect was a preview of his retirement announcement, Frank wrote earlier this year that he had grown exasperated with the increasing gridlock in this era of hyper-partisanship.

“Partisanship is a legitimate concept,” he wrote in Paulson’s book, “that has been discredited by the excesses of too many of its practitioners.”