This paper develops rare-event simulation methods for the estimation of portfolio credit risk-the risk of losses to a portfolio resulting from defaults of assets in the portfolio. Portfolio credit risk is measured through probabilities of large losses, which are typically due to defaults of many obligors (sources of credit risk) to which a portfolio is exposed. An essential element of a portfolio view of credit risk is a model of dependence between these sources of credit risk: large losses occur rarely and are most likely to result from systematic risk factors that affect multiple obligors. As a consequence, estimating portfolio credit risk poses a challenge both because of the rare-event property of large losses and the dependence between defaults. To address this problem, we develop an importance sampling technique within the widely used Gaussian copula model of dependence. We focus on difficulties arising in multifactor models-that is, models in which multiple factors may be common to multiple obligors, resulting in complex dependence between defaults. Our importance sampling procedure shifts the mean of the common factor to increase the frequency of large losses. In multifactor models, different combinations of factor outcomes and defaults can produce large losses, so our method combines multiple importance sampling distributions, each associated with a shift in the mean of common factors. We characterize "optimal" mean shifts. Finding these points is both a combinatorial problem and a convex optimization problem, so we address computational aspects of this step as well. We establish asymptotic optimality results for our method, showing that-unlike standard simulation-it remains efficient as the event of interest becomes rarer.