In this paper, an approach is developed for relative state estimation of satellite formation flying. To estimate relative states of two satellites, the Extended Kalman Filter Algorithm is adopted with the relative distance and speed between two satellites and attitude of satellite for measurements. Numerical simulations are conducted under two circumstances. The first one presents both chief and deputy satellites are orbiting a circular reference orbit around a perfectly spherical Earth model with no disturbing acceleration, in which the elementary relative orbital motion is taken into account. In reality, however, the Earth is not a perfect sphere, but rather an oblate spheroid, and both satellites are under the effect of $J_2$ geopotential disturbance, which causes the relative distance between two satellites to be on the gradual increase. A near-Earth orbit decays as a result of atmospheric drag. In order to remove the modeling error, the second scenario incorporates the effect of the $J_2$ geopotential force, and the atmospheric drag, and the eccentricity in satellite orbit are also considered.