A random three-dimensional (3D) porous medium can be reconstructed from a two-dimensional (2D) image by reconstructing an image from the original 2D image, and then repeatedly using the result to reconstruct the next 2D image. The reconstructed images are then stacked together to generate the entire reconstructed 3D porous medium. To perform this successfully, a very important issue must be addressed, i.e., controlling the continuity and variability among adjacent layers. Continuity and variability, which are consistent with the statistics characteristic of the training image (TI), ensure that the reconstructed result matches the TI. By selecting the number and location of the sampling points in the sampling process, the continuity and variability can be controlled directly, and thus the characteristics of the reconstructed image can be controlled indirectly. In this paper, we propose and develop an original sampling method called three-step sampling. In our sampling method, sampling points are extracted successively from the center of 5×5 and 3×3 sampling templates and the edge area based on a two-point correlation function. The continuity and variability of adjacent layers were considered during the three steps of the sampling process. Our method was tested on a Berea sandstone sample, and the reconstructed result was compared with the original sample, using tests involving porosity distribution, the lineal path function, the autocorrelation function, the pore and throat size distributions, and two-phase flow relative permeabilities. The comparison indicates that many statistical characteristics of the reconstructed result match with the TI and the reference 3D medium perfectly.