A user-defined bonded-particle model (UBM) which is based on the modified parallel bond was established in this paper to investigate the tensile and compressive failure mechanism of concrete on the three-dimensional (3D) level. The contact constitutive relation and the failure criterion of the UBM can be added to the commercial discrete element software PFC 3D by compiling them as a dynamic link library file and loading it into PFC 3D whenever needed. In addition, the aggregate particles can be generated according to the volume fraction and the shape of each aggregate is irregular. Then, by comparing the results of numerical simulation with the results of laboratory tests, it is found that this bonded-particle model can simulate the tensile and compressive failure process of concrete well to a certain extent. Specifically, the two have basically similar failure patterns and stress-strain responses no matter under tension or compression loading condition. All results indicate that this UBM is a promising tool in understanding and predicting the tensile and compressive failure process of concrete. which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.