We present a general nonperturbative method for constructing an integr
able Hamiltonian that is close to a given nonintegrable one. The exist
ing invariant tori of the original Hamiltonian are accurately approxim
ated by the constructed one. We illustrate the method by applying it t
o apparently near-integrable gravitational potentials for which no und
erlying integrable Hamiltonians are known.