Coagulation factor XI (FXI) has emerged as a promising target for the development of safer anticoagulation drugs that limit the risk of severe and life-threatening bleeding. Herein, we report the first cyclic peptide-based FXI inhibitor that selectively and potently inhibits activated FXI (FXIa) in human and animal blood. The cyclic peptide inhibitor (K i = 2.8 ± 0.5 nM) achieved anticoagulation effects that are comparable to that of the gold standard heparin applied at a therapeutic dose (0.3−0.7 IU/ mL in plasma) but with a substantially broader estimated therapeutic range. We extended the plasma half-life of the peptide via PEGylation and demonstrated effective FXIa inhibition over extended periods in vivo. We validated the anticoagulant effects of the PEGylated inhibitor in an ex vivo hemodialysis model with human blood. Our work shows that FXI can be selectively targeted with peptides and provides a promising candidate for the development of a safe anticoagulation therapy.