Editor's note: Fareed Zakaria is an author and foreign affairs analyst who hosts "Fareed Zakaria GPS" on CNN U.S. on Sundays at 10 a.m. and 1 p.m. ET and CNN International at 2 and 10 p.m. Central European Time/5 p.m. Abu Dhabi/9 p.m. Hong Kong.

New York (CNN) -- Most Americans oppose it, but the government's bailout of Wall Street appears in hindsight as a heroic rescue that kept the world economy from collapsing, says analyst Fareed Zakaria.

The Wall Street investment bank Lehman Brothers failed two years ago, leading to a massive loss of faith in the banking system and to a dramatic drop in the world economy. Congress passed the bank bailout known as TARP, or Troubled Asset Relief Program, in October 2008, the month after Lehman's collapse.

Zakaria said the creation and passage of TARP during the waning days of the Bush administration required extraordinary cooperation between Democrats and Republicans in Washington.

"It was a very difficult thing to do, to take billions of taxpayer dollars and bail out the financial institutions that precipitated the crisis," Zakaria said. "I would make only two points, if it would make people feel any better. First, the management of most of the banks that really screwed up were, in almost every case, let go ... and finally the government didn't spend an enormous amount of money on it. Because TARP was so successful, the financial system recovered pretty rapidly and most of the government's investments in those banks have made a healthy profit."

The author and host of CNN's "Fareed Zakaria GPS" spoke to CNN on Thursday. Here is an edited transcript:

CNN: Two years after the collapse of Lehman Brothers and the start of the financial meltdown, what have we learned?

Fareed Zakaria: When Henry Kissinger met with Chou En-Lai during the opening to China, they got to talking about the French Revolution, and Kissinger said, "What do you think of the French Revolution, what do you think its impact has been on the world?" Chou En-Lai, speaking 200 years after the French Revolution said, "It's too soon to tell."

It may be too soon to draw grand lessons from it, in terms of Lehman Brothers itself, the collapse. Some people see it as a massive blunder; others see it as inevitable.

I do think it's worth remembering that at the time, in the month before Lehman Brothers collapsed, the conventional wisdom was that the administration had made a mistake in rescuing Bear Stearns, that the banks had mismanaged themselves, they needed to feel the pain of the consequences of that mismanagement, and that it was important that there not be a bailout of these irresponsible banks that had loaded up their balance sheets with bad derivative contracts. And in that context it would have been very difficult to make the case for a bailout.

CNN: If it hadn't been Lehman Brothers, would there have been something else that would have brought down a financial system that was full of shoddy understandings and contracts?

Zakaria: Yes, there's no question that things had gotten so out of whack that there were going to be problems, and probably a cascading set of problems, but it's also fair to say that if Lehman had been rescued, at the very least you can make an argument that these problems would have unfolded in a slow motion way and therefore in a more containable fashion. ...

It's also worth pointing out, that if not for the collapse of Lehman Brothers, it would have been impossible to shock the political system into coming to the rescue, into recognizing that this was a huge, deep financial crisis, a systemwide crisis that required extraordinary measures on the part of the U.S. government. ... Without the collapse of Lehman Brothers, it would have been very difficult to have effected the rescue operation that took place over the next month.

CNN: And how does that rescue operation look now two years later?

Zakaria: There's a fairly clear consensus among the experts. A month after Lehman Brothers failed, what was happening was virtually unprecedented, even compared to the Great Depression.

Credit in America literally froze. Banks were not lending to anybody. Companies were not able to get short-term loans to pay their people or to pay their suppliers. ... 1.7 million jobs were lost in the fourth quarter of 2008, which was the sharpest drop in employment in 65 years, GDP [gross domestic product] shrank 6 percent in one quarter, which is again the biggest drop since the 1930s. And the contraction in global trade was actually even greater than the first years of the 1930s. We were clearly headed for something like the Great Depression.

CNN: So why didn't the financial crash trigger a depression?

Zakaria: In that atmosphere of crisis, you had this miraculous thing happen in Washington, which was that the Democrats and Republicans come together, and have [then-Treasury Secretary] Hank Paulson and [Rep.] Barney Frank working together and they passed TARP. In addition, the Federal Reserve was taking extraordinary measures. All of that collectively stabilized the system.

Now in retrospect, you could look back and say this piece or that piece wasn't designed exactly right ... but at that moment the fact that they were able to act and to act with massive resolution, it stabilized the financial system because it sent a message that the government was backstopping the financial system and that therefore it was not going to collapse, there was no point betting against it. ... I think that that month after Lehman you saw this quite heroic rescue effort that stabilized not only the American economy but the world economy. Now I realize that 60 percent of Americans think it was a bad idea.

CNN: Why are people so opposed to it?

Zakaria: For two reasons. One is that it has been viewed in moral terms when it should be viewed in practical terms -- the banks are the ones that got us into this mess, and they were the ones who got bailed out. I completely understand that ... and I feel that way, but here's the problem -- if the banks go under, there goes the whole economy. And so to save the economy, you have to save the banks, and that meant recapitalizing them, putting fresh capital in them, which is basically what TARP did.

The fact that the Bush and Obama people, of two very different political persuasions, agreed on that should tell us something -- that it was a practical necessity not some kind of ideological policies.

The second problem is that TARP got mixed up in the public's mind with the stimulus and with government spending in general. People opposed the stimulus because they associated it with the bank bailout. The polling shows that if you ask people, do you think we should have been firing schoolteachers or cutting off unemployment payments, they say no -- that was the stimulus. ... It was a very tough situation; you had to do what was economically necessary, even though it was not politically popular.

CNN: What's the connection between the rescue of the financial system and reviving growth in the American economy?

Zakaria: Modern economies live on credit. Even if you're not a company that's trying to be wildly irresponsible and take on massive amounts of debt, the reality of the modern economy is that you get your payments in January, and you pay your employees in June or vice versa and in order to bridge those periods, you need lots of credit. ... When you make investments, it often makes sense to borrow money. ...

I understand some people think banks are not lending enough, but remember, when banks were lending too much that was what was causing the problem in the first place. ... My sense is that credit is growing. The problem right now is just the reality that Americans are not spending, and 70 percent of the American economy is consumer spending. ... There's less demand for product and businesses don't invest.

CNN: What accounts for the level of bipartisanship in developing the TARP bailout, and why doesn't that kind of cooperation between parties happen now?

Zakaria: It's really fascinating to look back at that, a time when you were really able to get genuine bipartisanship when people thought they were doing what was best for the country. Even if you disagree with the outcome, it's something to marvel at, that you were able to get Republicans and Democrats in both houses and the White House to focus on what's best for the country.

I think there's a very interesting lesson -- when you have a genuine crisis, it forces people to stop the politics and start thinking about the country. In the weeks after Lehman Brothers, people genuinely thought there was a possibility the entire financial system would collapse and the entire American economy would come grinding to a halt.

The sad thing is that it seems as though it's only a crisis like this that can get people to be bipartisan any more, that we can only respond when there's an actual heart attack to the system. The problems we face in the future are less like heart attacks, which we respond to well, and more like cancer, slow-growing problems, that if they are not tackled early will simply grow and spread and metastasize.

How we achieve that same level of public spiritedness and bipartisanship is the great question for the United States, because we do face these problems and they do require the two parties to work together.