The surge in international asset trade since the early 1990s has lead to renewed interest in models with international portfolio choice. We develop the implications of portfolio choice for both gross and net international capital flows in the context of a simple two-country dynamic stochastic general equilibrium (DSGE) model. We focus on the time-variation in portfolio allocation following shocks, and resulting capital flows. Endogenous time-variation in expected returns and risk, which are the key determinants of portfolio choice, affect capital flows in often subtle ways. The model is consistent with a broad range of empirical evidence. An additional contribution of the paper is to overcome the technical difficulty of solving DSGE models with portfolio choice by developing a broadly applicable solution method.