In this paper we develop an open-economy endogenous growth model to examine the influence of fiscal policy on the economy in the long run. We allow for public deficit and 5 types of taxes. One of the novel features is separate treatment of interest rates on public and private debt, both of which are linear functions of appropriate debt-to-GDP ratios. Two extreme situations are analyzed: a model of “decentralized economy”, where economic agents do not take into account any externalities, and a model of “benevolent social planner”. We derive the rules of optimal fiscal policy that induce economic agents to internalize all externalities. Theoretical results are illustrated with an empirical analysis for Poland. The optimal values of several fiscal policy instruments for Poland are calculated.