Kalman or Kalman-related filtering methods are routinely applied in precise point positioning (PPP). However, in robot simultaneous localization and mapping (SLAM) systems, the factor graph optimization (FGO) has proved advantages over filtering methods in recent years, e.g., reducing the linearization errors and support of plug-and-play feature for multiple sensor fusion. Therefore, it would be interesting to apply the FGO to PPP. In addition, it will also facilitate the tight integration of PPP with Visual/LiDAR SLAM. In this work, PPP is solved under the factor graph optimization framework. A factor graph for PPP has been constructed. Results from 268 IGS-MGEX stations show that the factor graph optimization method can achieve a similar performance with that of Kalman filtering. First, the positioning accuracy in the convergence period can be improved for PPP based on factor graph optimization because it optimizes the entire state variables based on all the available observations. For applications that do not require real-time processing, the observation after the current states, e.g., future observations, can also be used to enhance the current state estimation. Second, the accuracy of static PPP is almost the same for the two methods with millimeter-accuracy for horizontal directions and centimeter-accuracy for vertical directions. Third, the kinematic PPP for both methods can achieve centimeter-level accuracy in horizontal directions and decimeter-level accuracy in vertical directions. Although the performance is comparable, it is noted that the computational efficiency of factor graph optimization method is still a problem. For each epoch, the average of elapsed time for Kalman filtering is 132 microseconds, while that of factor graph optimization method is 9664 microseconds. The elapsed time of factor graph optimization method can be further improved if the fix-window optimization technique is applied, which will be investigated in the future.