We study optimal taxation in an economy with financial frictions, in which the government cannot directly redistribute towards the agents in need of liquidity but otherwise has access to a complete set of linear tax instruments. We establish a stark result. Provided this is feasible, optimal policy calls for the government to increase its debt, up to the point at which it provides sufficient liquidity to avoid financial constraints. In this case, capital-income taxes are zero in the long run, and the returns on government debt and capital are equalized. However, if the fiscal space is insufficient, a wedge opens between the rates of return on government debt and capital. In this case, optimal long-run tax policy is driven by a trade-off between the desire to mitigate financial frictions by subsidizing capital and the incentive to exploit the quasi-rents accruing to producers of capital by taxing capital instead. This latter incentive magnifies the wedge between rates of return on government debt and capital. It also makes it optimal to distort downward the interest rate on government debt in periods of high government spending.