This paper shows that social security may be an important factor in explaining the equity premium puzzle. In the absence of shortselling constraints, the young shortsell bonds to the middle-aged and buy equity. Social security reduces the bond demand of the middle-aged, thereby restricting the possibilities of the young to finance their equity purchases. Their equity demand increases as does the average return to equity. Social security also increases the covariance between future consumption and the equity income of the young. The effect on the equity premium is substantial. In fact, a model with social security and borrowing constraints can generate a fairly realistic equity premium.