The purpose of the study is to develop effective ways to solve the problems of managing the quality of the loan portfolio of the Ukrainian banking sector in the context of the financial crisis caused by the russian-Ukrainian war. In the course of the study, such scientific methods as fundamental provisions of the credit portfolio theory, multifactor regression analysis, extrapolation, trend analysis, mathematical programming, etc. have been used. A methodical approach to the study of contemporary problems and prospects of loan portfolio quality management under martial law, consisting in modelling the profitability of the Ukrainian banking sector, taking into account the quality of the loan portfolio, has been proposed. This approach is implemented by constructing a two-factor power regression equation; forecasting with the establishment of confidence intervals and the development of 3 forecast scenarios (realistic, pessimistic and optimistic); solving the target function to maximize the profit of the banking sector, taking into account the restrictions formed on the basis of forecasting results. A power model of dependence of Ukrainian banking sector profitability on the volume of loan portfolio and non-performing loans has been built and its statistical significance has been established on the basis of official statistics for 2012–2022. It has been determined that an increase in the volume of the bank loan portfolio by 1% leads to an increase in bank income by 3.1%, while an increase in the volume of non-performing loans by 1% leads to a 0.28% reduction in revenues of the banking sector of Ukraine. The loan portfolio and NPL series have been extrapolated to 2023–2025, which is consistent with the medium-term, as long-term projections would be unreliable under martial law and deep recession. According to the results of medium-term forecasting and optimization, it has been proved that the maximum growth of bank revenues by 60.4%, compared to 2022, is possible with an increase in the loan portfolio by 18.9%, a reduction of non-performing loans by 26% and a reduction of their share in the loan portfolio by 13.9%. It has been justified that the key condition for maximising bank revenues is the soonest termination of the russian-Ukrainian war and further expansion of effective government concessional lending programs. In particular, the effectiveness of the state program “Affordable Loans 5–7–9%”, which provided 19% of the bank loan portfolio in Ukraine and became a key mechanism of anti-crisis business support both during the COVID-19 pandemic and during the large-scale invasion from 2022 during the russian-Ukrainian war, has been substantiated.