Factor XII (FXII) is a plasma protease that has emerged in recent years as a potential target to treat or prevent pathological thrombosis, to inhibit contact activation in extracorporeal circulation, and to treat the swelling disorder hereditary angioedema. While several protein based inhibitors with high affinity for activated FXII (FXIIa) were developed, the generation of small molecule inhibitors has been challenging. In this work, we have generated a potent and selective FXIIa inhibitor by optimizing a peptide macrocycle that was recently evolved by phage display (K-i = 0.84 +/- 0.03 nM). A fluorine atom introduced in the para-position of phenylalanine enhanced the binding affinity as much as 10-fold. Furthermore, we improved the proteolytic stability by substituting the N-terminal arginine by norarginine. The resulting inhibitor combines high inhibitory affinity and selectivity with a good stability in plasma (Ki = 1.63 +/- 0.18 nM, >27 000-fold selectivity, t(1/2)(plasma) =16 +/- 4 h). The inhibitor efficiently blocked activation of the intrinsic coagulation pathway in human blood ex vivo.