This invention relates to compounds of formula (I) and methods of treatment using the compounds. The invention also relates to processes and methods for producing the compounds of the invention. The compounds of the invention are modulators of Factor XII (e.g. Factor XIIa). In particular, the compounds are inhibitors of Factor XIIa and may be useful as anticoagulants.