In this paper, we study the effects of government debt on macroeconomic aggregates in a non-Ricardian framework. We develop a microfounded framework that combines time-varying markups, endogenous labor supply, and overlapping generations based on infinitely lived families. The main contribution of this paper is to provide a new transmission mechanism for public debt through the countercyclical markup movements induced by external deep habits. We analyze the effects of a positive shock to public debt. We show that the interest rate rises, entailing higher markups and a fall in employment and consumption. Interestingly, even without capital, a crowding-out effect of government debt is obtained in the long run. In addition, we show that when prices are sticky, public debt has a short-run expansionary effect, which is strengthened by the presence of deep habits.