An inhibitor of FXII/FXIIa for the prevention of the formation and/or stabilization of thrombi during and/or after a medical procedure performed on a human or animal subject comprising contacting blood of said human or animal subject with artificial surfaces, wherein said inhibitor of FXII/FXIIa is administered before and/or during and/or after said medical procedure.