Barney Frank, the longtime Democratic congressman who helped bring new visibility to gay rights while also shaping the most significant financial-system reforms in a generation, died Tuesday, according to a close friend and former campaign manager. He was 86.

Frank died late Tuesday, Jim Segel said, as Frank’s life and public career ended in hospice care in Ogunquit, Maine. Segel described Frank’s illness timeline as beginning when Frank entered hospice in April with congestive heart failure.

In Congress, Frank spent 32 years representing broad swaths of Boston’s suburbs before he and his husband, Jim Ready, moved to Ogunquit. He was survived by his husband, Ready, and by his sisters Ann Lewis and Doris Breay, along with brother David Frank.

Frank described himself as a “left-handed gay Jew” and was known for a combination of sharp wit and combative style, with a focus on marginalized communities. He represented the party’s left wing while maintaining close relationships with Democratic leaders who sometimes frustrated progressives.

Frank publicly came out as gay in 1987, becoming the first member of Congress to do so voluntarily. With his 2012 marriage to Ready, he became the first incumbent lawmaker on Capitol Hill to marry someone of the same sex.

While Frank’s role in gay-rights advocacy made him a prominent national figure, his policy work reached far beyond social issues. By 2007, he chaired the House Financial Services Committee, where he helped craft the post-crisis overhaul that became the Dodd-Frank Act. The act enhanced consumer protections, imposed new capital requirements for banks, and expanded the ability of regulators to monitor risk.

Frank also sought to preserve a pragmatic political approach in the face of ideological conflict. In an April interview as he entered hospice, he said he hoped he would be remembered for advocating progressive ideals without forcing them on voters prematurely, and he warned that the “main obstacle” to defeating populism and moving further in the “right direction” was that mainstream Democrats had to show they opposed parts of the left’s agenda that were “politically unacceptable.” In that interview, Frank also urged Democrats not to make the “most unpopular parts of your agenda” into “litmus tests.”

Close colleagues praised Frank’s combination of idealism and results. Nancy Pelosi, the former House speaker, called him an “idealist to the nth degree,” saying in an interview that “Nobody could ever surpass what he brought to the table in that regard.” Chris Dodd, who worked with Frank on the banking bill that produced the law, said in a statement that he and Frank shared a “fantastic relationship,” adding that there were “many good moments” in his years in Congress but “none more significant, joyful, or productive than” the two years they spent working on the banking bill.

Frank’s path into public life also reflected a commitment to civil rights and political organization. He wrote in a 2015 memoir that he was drawn to public life after Emmett Till was lynched in Mississippi, volunteering during the 1964 Freedom Summer. He later said that his speech and accent made his direct organizing of Mississippi voters “largely incomprehensible” to rural Mississippians of both races.

At the end of his life, Frank remained a critic of the direction of American politics, including President Donald Trump. Asked for his prediction on who might succeed Trump, Frank said, “unfortunately I won’t get to vote for it.”

As Frank’s death becomes another entry in the record of major political figures leaving public life, it also closes the chapter on a lawmaker who combined early and highly visible gay advocacy with legislative work that Democrats and Republicans alike have argued over since the financial crisis.