Abstract This paper studies if imperfections in the labor market justify a different fiscal policy. We present a dynamic general equilibrium model with a Ramsey planner deciding about public spending, labor taxes and debt. Two different labor market setups are considered. First we assume a competitive labor market and then we introduce a union with monopoly power. Both models reach the same conclusion as regards to the cyclical properties of the optimal policy: it is not optimal to implement a countercyclical fiscal policy. We also find that government spending should be larger under perfect competition. These main results arise both under complete and incomplete markets for the debt.