Masonry structure is heterogeneous and has been widely used in building and construction engineering. The study on cracking pattern of masonry structure is significant to engineering design. Many previous investigations on the failure process of masonry structure are usually based on the homogenization technique by selecting a typical unit of masonry to serve as a representative volume. This kind of numerical analysis neglects the mesoscopic heterogeneous structure, which cannot capture the full cracking process of masonry structures. The cracking process of masonry structure is dominantly affected by its heterogeneous internal structures. In this paper, a mesoscopic mechanical model of masonry material is developed to simulate the behavior of masonry structure. Considering the heterogeneity of masonry material, based on the damage mechanics and elastic-brittle theory, the new developed Material Failure Process Analysis (MFPA2D) system was put forward to simulate the cracking process of masonry structure, which was considered as a two-phase composite of block and mortar phases. The crack propagation processes simulated with this model shows good agreement with those of experimental observations. The numerical results show that numerical analysis clearly reflect the modification, transference and their interaction of the stress field and damage evolution process which are difficult to achieve by physical experiments. It provides a new method to research the forecast theory of failure and seismicity of masonry. It has been found that the fracture of masonry observed at the macroscopic level is predominantly caused by tensile damage at the mesoscopic level.