In just two hours, Jamie Dimon went from Washington’s whipping boy to the Republican Party’s brain trust on regulating Wall Street.

Jamie Dimon, chief executive officer of JPMorgan Chase. (Andrew Harrer/Bloomberg)

But rather than castigate Dimon for his firm’s egregious mistakes, Senate Republicans treated him like a wise sage. They pointed to JPMorgan’s ability to withstand mismanagement and billions in losses as evidence of the bank’s health — and solicited Dimon’s own advice on how Washington should treat Wall Street.

“What would you do to make our system safer?” Sen. Bob Corker (R-Tenn.) asked Dimon.

“What should the function of regulators be?” asked Sen. Mike Crapo (R-Ida.).

“How much have regulation costs increased?” asked Sen. Mike Johanns (R-Neb.).

“We’re honestly looking for some ideas as we look over [Dodd-Frank] in the next year,” Sen. Jim DeMint (R-S.C.) told him.

Even some of the Democrats sought out Dimon’s advice: Sen. Michael Bennet (D-Colo.), for instance, asked for his thoughts on solving the country’s long-term deficit crisis.

Dimon was more than happy to oblige. “I believe in strong regulation but smart regulations — not necessarily more regulations,” he said. Dimon did admit he was “dead wrong” when he dismissed early concerns about massive trading losses. But he assured the Senate committee that banks were always going to be able to foresee problems before any government watchdog. “Our risk committee took our company through the most difficult financial crisis of all time with flying colors,” Dimon said. “If it would be hard for us to capture it, it would be hard for [regulators] for capture.”

JPMorgan did weather the storm better than some of its counterparts during the crisis, but that didn’t stop the bank from accepting a $25 billion bailout under TARP or borrowing $48 billion through the Federal Reserve’s Term Auction Facility in February 2009. Dimon, however, argued that the system is now safer because the private banks righted themselves of their own accord. “Lots of things that caused the problem don’t exist any more. That wasn’t because of regulation — it was because of markets,” he concluded. (Dimon has long asserted that JPMorgan never needed TARP, but was asked to take the funds and went along for the sake of other banks.)

Republicans on the committee heartily concurred. After all, Dimon reiterated many of the same arguments they have used all along in their effort to repeal Dodd-Frank. “I absolutely, strongly agree with that,” DeMint said. “I strongly endorse the concept of not more regulation but smarter regulation.”

And they ultimately portrayed JPMorgan as the poster child of a successful global bank that should be admired and protected — not castigated and restrained. “I doubt you’re considering locating [a branch] in my state, although it’d be a great place for you to do business,” Johanns joked, as chuckles broke out in the audience.

In fact, the GOP senators made it clear that their nightmare scenario wasn’t another financial crisis brought on by banks, but a world where regulation choked off free enterprise. “What societal good is an institution like this? What would society be like without these institutions?” Corker asked him. Dimon happily rattled off all the ways that JPMorgan and capital markets benefit everyone from Fortune 500 companies to “mothers and veterans.”

Democrats tried — and largely failed — to make Dimon squirm. Sen. Robert Menendez (D-N.J.) pressed for an answer on whether the London Whale bet was, in fact, a gamble meant to make money rather than simply a hedge to protect the bank. “What did it morph into, Russian roulette?” he asked. After all, what would stop JPMorgan or another bank from making even bets and losing, say, $50 billion instead of $2 billion the next time around, having failed to catch the London Whale this time around?

But Dimon remained calm and collected, pointing out his support for many individual components of Dodd-Frank. “We supported higher capital, we supported higher liquidity, we supported the oversight committee,” he replied. “We did not fight anything.” In fact, JPMorgan has spent millions on lobbying to alter Dodd-Frank. And Dimon reiterated his skepticism about the Volcker Rule before the committee, calling it “unnecessary.”

Sen. Jeff Merkeley (D-Ore.) was the only senator who seemed to get under his skin, when Dimon tried to interrupt his remarks on how the bank had benefitted from federal bailouts.

“Sir, this is not your hearing,” Merkeley said sharply, cutting Dimon off.

But, in many ways, it was.