The study of the motions of planets, satellites, and other celestial bodies is one of the important problems in basic physics and astronomy. The solution to the two-body problem enables astronomers to predict the orbits of the Moon, satellites, and spaceships around the Earth. The general analytic solution for the three-body problem stands unsolved except in some special cases, such as the Sun-Earth-Moon problem, in which the mass of the Moon is neglected. This reduces the problem to a two-body problem. In this work, the author presents a general solution to the problem in a closed form in terms of two basic particle-particle vectors. The position vector of each particle is expressed in terms of the centre of mass and the two basic particle-particle vectors. This solution is used for studying the three-body problem with gravitational interaction without imposing the non-zero-total angular-momentum condition or ignoring any masses. The Sun-Earth-Moon problem was solved in the general case and showed an expected orbital motion with a perturbation in the Earth-Sun orbit due to the revolution of the Moon. This solution is the key to future studies for n-body problem solutions.