When a borrower faces a hold-up problem, deteriorating bank health might reduce a borrower's credit availability. However, a bank with an impaired balance-sheet might attempt to 'gamble for resurrection' and hence might increase risky lending to zombie firms. The purpose of this paper is to investigate what impacts weakened financial conditions of banks had on loans outstanding to medium size firms in Japan. Estimating lending functions, we examine the determinants of lending to unlisted Japanese companies in the late 1990s and the early 2000s. We find that two alternative measures of the bank health, regulatory capital adequacy ratios and ratios of non-performing loans (NPLs), had opposite impacts on lending. In the case of regulatory capital adequacy ratios, its deterioration had a perverse impact on the bank's lending. The deteriorating NPL ratios, however, increased lending to troubled firms to keep otherwise economically bankrupt firms alive.