This “lender of last resort” role for central banks was codified by British journalist and economist Walter Bagehot in his 1873 book, Lombard Street.

In a panic, Bagehot advised, a central bank should lend freely on good collateral and charge a high rate of interest to discourage overuse. And a central bank, he said, should only lend to those who were ultimately solvent- that is, to banks with loans and other assets greater than their deposits and other borrowing.  The last condition was significant: the point was to keep otherwise healthy banks from being wiped out in a panic, not to sustain banks that were broke or, or in the jargon of the trade, “insolvent.”  In other words, the central bank was the solution to a shortage of liquidity, not the solution to insolvency. Identifying that fine line between liquidity and solvency in the midst of a financial panic would be perhaps the biggest challenge for the Bernanke Fed. Its biggest gambles hinged on getting this diagnosis right: the difference between lending to Bear Stearns (liquidity) and not lending to Lehman (insolvency)….

From In Fed We Trust- Ben Bernanke’s War on the Great Panic by David Wessel