In this paper we describe a theoretical model of optimal investment of various types of financially constrained firms. We show that the resulting relationship between internal funds and investment is non-monotonic. In particular, the magnitude of the cash flow sensitivity of the investment is lower for firms with credit rationing compared to firms that are able to obtain short-term external financing. The inverse relationship is driven by the leverage multiplier effect. A positive cash flow shock increases the short-term borrowing capacity of the firm, which in turn has a positive effect on investment and firm's growth. Moreover, the leverage multiplier effect is the highest for firms relying on short-term credits and it is lower for firms that are able to obtain long-term financing. Analysing a large euro area data set we find strong empirical support for our theoretical predictions. The results also help to explain some contradictory findings in the financing constraints literature.