In the political debate people express the idea that immigrants are good because they can help pay for the old. The paper explores this idea in a dynamic political-economy setup. We characterize sub-game perfect Markov equilibria where immigration policy and pay-as-yougo (PAYG) social security system are jointly determined through a majority voting process. The main feature of the model is that immigrants are desirable for the sustainability of the social security system, because the political system is able to manipulate the ratio of old to young and thereby the coalition which supports future high social security benefits. We demonstrate that the older is the native born population the more likely is that the immigration policy is liberalized; which in turn has a positive effect on the sustainability of the social security system.