We propose a dynamic general equilibrium model that yields testable implications about the fiscal policy run by governments of different political color. Successive generations of voters choose taxation, expenditure, and government debt through repeated elections. Voters are heterogeneous by age and by the intensity of their preferences for public good provision. The political equilibrium switches stochastically between left- (pro-public goods) and right-leaning (pro-private consumption) governments. A shift to the left (right) is associated with a fall (increase) in government debt, an increase (fall) in taxation, and an increase (fall) in government expenditures. However, left-leaning governments engage in more debt accumulation during recessions. These predictions are shown to be consistent with the time-series evidence for the United States in the postwar period, and also with the evidence for a panel of OECD countries.