A novel scheme based on the chiral Lagrangian is applied to the nucleon-nucleon interaction close to threshold. Subthreshold partial-wave amplitudes are calculated in chiral perturbation theory and analytically extrapolated above threshold. The constraints imposed by analyticity and unitarity are used to stabilize the extrapolation. A reasonable description of the empirical phase shifts up to laboratory energies T-lab similar or equal to 300MeV is obtained in terms of the parameters relevant at next-to-next-to-next-to-leading order. The convergence properties of the method and the comparison with the conventional potential approach are discussed.