The Fanshi Basin is one of the NE–SW-striking depocentres formed along the northern segment of the fault-bounded Shanxi rift. In order to understand the crustal driving stresses that led to the basin formation and development, a palaeostress analysis of a large quantity of fault-slip data collected mainly at the boundaries of the basin was accomplished. The stress inversion of these data revealed three stress regimes. The oldest SR1 was a Neogene stress regime giving rise to a strike-slip deformation with NE–SW contraction and NW–SE extension. SR1 activated the large faults trending NNE–NE, i.e. (sub)parallel to the main strike of the Shanxi rift, as right-lateral strike-slip faults. It was subjected to the Shanxi rift before the activation of the Fanshi Basin boundary fault, i.e. the Fanshi (or Wutai) fault, as a normal fault. The next is a short-lived NE–SW extensional stress regime SR2 in early Pleistocene time, which shows the inception of the basin’s extension. A strong NW–SE to NNW–SSE extensional stress regime SR3 has governed the northern segment of the Shanxi rift since late Pleistocene time and is the present-day extension. It gave rise to the current half-graben geometry of the Fanshi Basin by activating the Fanshi (or Wutai) fault as a normal fault in the southern part of the graben. Because of the dominance of the NW–SE to NNW–SSE extension, which is perpendicular to the NE–SW extension, mutual permutations between σ3 and σ2 due to inherited fault patterns might have occurred while the crustal stresses in the Fanshi Basin changed from the SR1 to SR3 stress regimes.