The objective of this study is to examine the factors affecting the budget deficit by using a panel dataset of 66 countries from 1996 to 2020. In the first stage regressions, the current study employs fixed and random effect models to estimate the impact of institutional quality and other economic variables on the budget deficit. In the second stage regression, pooled mean group (PMG) and mean group (MG) estimation method is employed for estimating the long-run and short-run coefficients for the effect of institutional quality and other economic variables on the budget deficit in a heterogeneous panel dataset. The empirical estimates confirm that GDP per capita is positively and significantly associated with the budget deficit in the long run. Further, inflation rates and trade openness also have positive and significant impacts on the budget deficit in the long run. Moreover, the results show that, in the long run, the population growth rate is negatively associated with budget deficit. As far as institutional variables are concerned, the empirical findings show that an increase in corruption in government institutions leads to a significant increase in the budget deficit. However, political stability, improved bureaucratic quality, democratic accountability and the rule of law lead to a reduction in the budget deficit. The current study will help policymakers and practitioners to better understand the determinants of the budget deficit and to design the policies for the improvement of institutional quality which, in turn, may control the level of a budget deficit. Jel Codes: H5, H6, H3, H4