A blue-ribbon commission had just excoriated Goldman Sachs and other Wall Street banks for fueling the financial crisis. Prosecutors were investigating whether Goldman had misled investors. The company was a whipping boy for politicians looking to lay blame for the crash.

But in spring of 2011, Lloyd C. Blankfein, leading one of the nation’s most reviled companies, found himself onstage with Secretary of State Hillary Clinton, one of the nation’s most admired public figures at the time. And Mrs. Clinton had come to praise Goldman Sachs.

The State Department, Mrs. Clinton announced that day in an auditorium in its Foggy Bottom headquarters, would throw its weight behind a Goldman philanthropic initiative aimed at encouraging female entrepreneurs around the world — a program Goldman viewed as central to rehabilitating its reputation.

Mrs. Clinton’s blessing — an important public seal of approval for Goldman at a time when it had few defenders in Washington — underscored a long-running relationship between one of the country’s most powerful financial firms and one of its most famous political families. Over 20-plus years, Goldman provided the Clintons with some of their most influential advisers, millions of dollars in campaign contributions and speaking fees, and financial support for the family foundation’s charitable programs.