In order to achieve high accuracy of autonomous navigation for Mars probes, an integrated navigation method using X-ray pulsar measurement and optical data of viewing Martian moons is proposed. For single X-ray pulsar measurement on board a Mars probe, navigation accuracy is low due to its poor observability. On the other hand, Phobos and Deimos, two natural moons of Mars, are important optical navigation information sources available for Mars missions. However, the Martian moons ephemeris bias and the differences between barycentre and centre of brightness of Martian moons will result in low navigation accuracy. The method of integrated navigation using X-ray pulsar measurement and optical data of viewing Martian moons can overcome the defect and achieve accurate navigation. Two sequential orbit determination algorithms, Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF), are compared. The simulation results show this method can obtain high autonomous navigation accuracy during the phase of a probe orbiting Mars.