The maximum tensile stress criterion and the Mohr-Coulomb criterion are incorporated into the extended non-ordinary state-based peridynamics (NOSB-PD) to simulate the initiation, propagation and coalescence of the pre-existing flaws in rocks subjected to compressive loads. Wing cracks, oblique secondary cracks, quasi-coplanar secondary cracks and anti-wing cracks can be modeled and distinguished using the proposed numerical method. In the present study, a four-point beam in bending with two notches as a benchmark example is firstly conducted to verify the ability, accuracy and numerical convergence of the proposed numerical method. Then, the numerical samples of rock materials containing the one single pre-existing flaw with various lengths under uniaxial compression are modeled. Four significant factors, i.e. the axial stress versus axial strain curves, the peak strength, the ultimate failure mode and crack coalescence process, are obtained from the present numerical simulation. The effect of the flaw length on the propagation of cracks is investigated. Next, sandstone samples containing three pre-existing flaws with different ligament angles under uniaxial compression are also simulated. The effect of ligament angle on the propagation and coalescence of cracks is studied. Finally, rock-like samples containing two parallel pre-existing flaws subjected to biaxial compressive loads with confining stresses of 2.5, 5.0, 7.5 and 10.0MPa are simulated. The effect of the confining stresses on the initiation, propagation and coalescence of flaws is investigated. The present numerical results are in good agreement with the previous experimental ones.