Serine proteases, such as thrombin, are contributors to the disruption of the blood–brain barrier (BBB) and exacerbate brain damage during ischemic stroke, for which the current clinical therapy remains unsatisfactory. However, the effect of nafamostat mesilate (NM), a synthetic serine protease inhibitor, on BBB disruption following cerebral ischemia is unknown. Here, we investigated the in vivo effect of NM on BBB integrity in rats subjected to transient middle cerebral artery occlusion (MCAO) and explored the possible mechanism in an in vitro BBB model comprising rat brain microvascular endothelial cells and astrocytes after oxygen and glucose deprivation (OGD) in the presence of thrombin. The results showed that NM treatment remarkably attenuated transient MCAO-induced brain infarcts, brain oedema and motor dysfunction in addition to BBB disruption, which might be related to changes in tight junction protein expression and localization. Meanwhile, NM preserved BBB integrity and alleviated the changes in tight junction protein expression and localization and cytoskeleton rearrangement in rat brain microvascular endothelial cells via thrombin inhibition. Our findings suggest that NM treatment can preserve BBB integrity through the inhibition of thrombin, which might be correlated with the regulation of PKCα/RhoA/MLC2 pathway components.