We study optimal Pareto-improving factor taxation when agents are heterogeneous in their labor productivity and wealth and markets are complete. Pareto-improving policies require a gradual reform: labor taxes should be cut, and capital taxes should remain high for a long time before reaching the limit. This policy redistributes wealth in favor of workers, promotes growth, and causes early deficits and government debt in the long run. We address several technical issues, such as sufficiency of Lagrangian solutions in a Ramsey problem, their relation to welfare functions, and solution algorithms.We also provide a proof that long-run capital taxes are zero.