In this June 24, 2009, photo, Herb Allison testifies on Capitol Hill in Washington. (Gerald Herbert/ASSOCIATED PRESS)

Herbert M. Allison Jr., the former president of investment bank Merrill Lynch and a key official in the U.S. response to the financial crisis that erupted in 2008, died July 14 at his home in Westport, Conn. He was 69.

The cause was an apparent heart attack, said his son Andrew Allison.

Mr. Allison was an eyewitness to the biggest financial upheavals of the past two decades. In the late 1990s, he saw the wreckage from the perspective of a senior executive at one of the top Wall Street firms. And in the end of the last decade, he was selected to run the District-based mortgage giant Fannie Mae after it was seized by the federal government.

Soon after, he became a senior U.S. official overseeing the government’s rescue of the financial system, which had distributed hundreds of billions of dollars to banks as part of the Troubled Asset Relief Program.

“Because of Herb’s extensive experience and sound leadership, TARP became one of the most successful financial rescue programs ever created and our nation avoided a second Great Depression,” Treasury Secretary Jack Lew said in a statement.

Mr. Allison spent the bulk of his career — 28 years — at Merrill Lynch. Three years after leaving the investment bank, he became chief executive of TIAA-CREF, which manages the retirement accounts of millions of teachers and other employees in the non-profit sector.

He retired from TIAA-CREF in 2008, and was on vacation with his family in the U.S. Virgin Islands when he received a call from Treasury Secretary Henry M. Paulson Jr. asking him to return immediately to Washington. Mr. Allison arrived on the steps of the Treasury Department in September of that year with only a backpack and tropical shirt in his possession.

Fannie Mae, whose prior leadership was sacked, was hemorrhaging money in the nation’s housing crisis. On the verge of insolvency, the George W. Bush administration saved it in order to stabilize the housing market.

Mr. Allison, who took a dollar a year as his salary, tried to rev up Fannie’s efforts to help homeowners facing foreclosures and keep the mortgage market functioning well.

With a backstop from the federal government and a new business plan, Fannie and its sibling, McLean-based Freddie Mac, ultimately stabilized, though not before the two firms combined cost taxpayers well over $100 billion.

After several months in that post, Mr. Allison was asked to serve as a senior official at Treasury, overseeing the Office of Financial Stability, which had responsibility for overseeing TARP. He replaced Neel Kashkari, a Bush administration holdover who had helped launch the program.

Firms rescued under the TARP program began paying back their loans, and the financial rescue began to fade from memory. Critics of the bailout argue that it offered many advantages to banks, which rapidly returned to healthy profitability, but failed to help many people on Main Street.

TARP money was used to bail out the automakers early in President Obama’s first term.

Mr. Allison was also part of discussions about how to compensate executives at banks and how to speed up the pace of federal aid to beleaguered homeowners.

When he retired from Treasury in the fall of 2010, he credited the TARP program with helping to save the economy. “When all is said and done, this program will be viewed as one of the most effective and least costly forms of assistance,” he said at the time.

Herbert Monroe Allison Jr. was born Aug. 2, 1943, in Pittsburgh and grew up in Garden City, on New York’s Long Island. His father was an FBI agent.

After graduating from Yale University with a philosophy degree in 1965, he served four years in the Navy during the Vietnam War. He received a master’s degree in business administration from Stanford University in 1971 before joining Merrill Lynch.

A few years later, he was working for Merrill in Tehran and helped launch the Tehran stock exchange. He also met his future wife, Simin Nazemi, whose father reportedly refused to let them marry until Mr. Allison learned Farsi.

Besides his wife, survivors include two sons, John Allison of New York City and Andrew Allison of Austin; and a brother.

Mr. Allison’s most tumultuous moment at Merrill came in 1998, when Long Term Capital Management, a major hedge fund, teetered on the verge of collapse. He helped orchestrate a bailout of the fund by the biggest names on Wall Street, averting a financial catastrophe.

A few years later, Mr. Allison left Merrill and served as the finance chairman of Sen. John McCain’s (R-Ariz.) unsuccessful presidential bid in 2000. Eight years later, he supported Obama’s winning presidential campaign.

In fall 2011, Mr. Allison was called back to service after Obama asked him to lead an independent review of federal loans to energy companies, after the controversy surrounding bankrupt solar-panel maker Solyndra. The report provided recommendations on ways to improve the loan program, including stricter financial oversight.

He also published an e-book, titled “The Megabanks Mess,” in which Mr. Allison said the nation’s largest banks faced failure in 2008 without government support. He called for the biggest banks to be broken up, a position deeply unpopular in his former industry.

“In terms of his legacy, I found it very interesting that he wrote this sort of manifesto type of book, which was so strongly worded and so scathing about the people involved,” said Anat R. Admati, a Stanford University professor of finance and economics and a noted critic of big banks. “He knew this industry very, very well from many different backgrounds.”