The classical Bagehotu0092s conception of a Lender of Last Resort (LOLR) that lends to illiquid banks has been criticized on two grounds: on the one hand, the distinction between insolvency and illiquidity is not clear cut; on the other a fully collateralized repo market allows Central Banks to provide the adequate aggregated amount of liquidity and leave the responsibility of lending uncollateralized to the banks. The object of this paper is to analyze rigorously these issues by providing a framework where liquidity shocks cannot be distinguished from solvency ones and ask whether there is a need for a LOLR and how should it operate. Determining the optimal LOLR policy requires a careful modeling of the structure of the interbank market and of the closure policy. In our set up, the results depend upon the existence of moral hazard. If the main source of moral hazard is the banksu0092 lack of incentives to screen loans, then the LOLR may have to intervene to improve the efficiency of an unsecured interbank market; if instead, the main source of moral hazard is loans monitoring, then the interbank market should be secured and the LOLR should never intervene.