A new interatomic potential has been developed for molecular-dynamics simulations of TiO2 based on the formalism of Streitz and Mintmire [J. Adhesion Sci. Technol. 8, 853 (1994)], in which atomic charges vary dynamically according to the generalized electronegativity-equalization principle. The present potential reproduces various quantities of rutile crystal including vibrational density of states, static dielectric constants, melting temperature, elastic moduli, and surface relaxation. Calculated cohesive-energy and dielectric constants for anatase crystal agree well with experimental data. The potential is applied to TiO2 nanoclusters (size 60-80Å) for both anatase and rutile phases to analyze their equilibrium configuration and spacecharge distribution. Stable double-charge layer is found in the surface region of a spherical nanocluster for both rutile and anatase, resulting in enhanced Coulomb-repulsion between the nanoclusters at close proximity.