This study was carried out to examine the effects of bank-specific factors and macroeconomics on the financial viability of commercial banks in Afghanistan. The ten banking institutions' panel data sets for the years 2010–2021 were used. A random Effect model of regression was applied. The model of random effects was recommended when the Hausman test was employed to confirm the models' fitness. The null hypotheses were also rejected based on the results of the Wooldridge test for serial correlation and the modified Wald test for group-wise heteroscedasticity. The findings of current research revealed that bank determinants, specifically liquidity and asset management, showed a positive but slight effect on bank profits, while deposit ratio, bank number of branches, and ATMs showed a negative influence. Regarding macroeconomic factors, the outcomes indicated that the influence of the GDP, exchange rate, and inflation rate on bank profitability was negative, while the interest rate, taxes, and industry growth rate had a positive and significant impact on bank profitability. Additionally, by highlighting weak points, the study's findings will assist the management of banks, financiers, the government, policymakers, and shareholders in taking better decisions and enhancing bank performance. Overall, decision-makers need to be better knowledgeable about the factors that affect the profitability of Afghan commercial banks.