For months, as he endured hearings on Capitol Hill and fought off a series of lawsuits, Bank of America CEO Ken Lewis trudged through a post-apocalyptic financial landscape against a steady drumbeat of questions about his future. The deal he had called “the strategic opportunity of a lifetime” — his purchase/salvage of Merrill Lynch — had swung from an act of patriotism, keeping the American way of banking from utter ruin, to a scandal over Merrill losses and bonuses.

Perhaps he should have seen the writing on the walls of the vacant houses financed by Countrywide, the mortgage lender Lewis purchased/salvaged just six months before the Merrill deal. The two transactions may have been strategic gems, but they were laced with political poison as the economy floundered toward its dramatic deleveraging and taxpayers pumped $20 billion into Bank of America to fund the Merrill deal.

“It was only a matter of time,” Campbell Harvey, a professor at Duke University’s business school, told Jon Stempel. “There is too much collateral damage.” As Stempel reports, Lewis spent north of $130 billion on acquisitions, including FleetBoston Financial Corp, the credit card issuer MBNA Corp, LaSalle Bank Corp, Countrywide, Charles Schwab Corp’s U.S. Trust private banking unit, and Merrill. In buying Merrill, he added a giant investment bank to what was already the largest U.S. retail bank, credit card issuer and mortgage provider. (Wells Fargo & Co has since become No. 1 in mortgages.)

Lewis plans to be gone by the end of the year and leaves no immediate successor, so Bank of America has only a few months to figure out who to anoint. Though his demise is a cautionary tale, odds are good that the bank’s worst days are behind it. An incoming chief can blame Lewis for any ill-conceived agreements surrounding Merrill. More importantly, with economic recovery apparently at hand, Lewis’ deals of a lifetime have a better chance than ever of paying off.