Building stones, particularly sandstone and granite, are very important in the building elements of Portugal’s historical and cultural heritage. Experimental research, based on uniaxial compressive tests, was carried out on selected representative samples of lithotypes of rocks used in historic built heritage, with a view to evaluating the compressive mechanical behaviour of different building stones. The results showed that porosity plays a central role in the compressive behaviour of granites and sandstones. As porosity can be evaluated in field conditions with non-destructive tests it was decided to derive an analytical model to predict compressive behaviour based on the knowledge of porosity of the building stones. A cubic polynomial function was adopted to describe the pre-peak regime under compression to implement the model. Furthermore, a statistical correlation between mechanical and porosity data had to be defined. Good agreement between experimental and analytical compressive stress–strain diagrams, from which the mechanical properties like compressive strength and modulus of elasticity can be derived, was achieved.