In this paper, the effect of hydrostatic testing internal pressure on the residual stresses of circumferentially butt-welded steel pipes is investigated by a three dimensional finite elements simulation based on ansys 11 code. Residual stresses due to welding process are calculated by an uncoupled analysis. In this analysis, at first, a transient heat transfer problem is solved. Output of this analysis is temperature distribution history .This output is used as the structural analysis load. Output of structural analysis is welding residual stresses. The most important part of such simulations is modeling of heat power source. In the present work, heat power of welding electrode is simulated by a moving heat source with Gaussian distribution on a spherical domain. The presented model is used for calculation of residual stresses in an 8 in. three pass butt-welded steel pipe. Finally, the effects of hydrostatic testing internal pressure on the residual stresses are studied by the proposed model. The results obtained from this study show that the hydrostatic testing pressure has a significant effect on residual stresses.