Central banks evolved, or were established by governments, to meet that need. Historically this role had important synergies with other central banking functions, and with other aspects of what we now call financial stability policy.
Under the gold standard, the lender of last resort (and the related liquidity management) functions were closely intertwined  1  Buiter (2012), The role of central banks in financial stability: how has it changed? CEPR Discussion Paper Series No. 8780. 2  Goodhart (1988), The Evolution of Central Banks, MIT Press.