The mechanism of action of heparin is that it binds to antithrombin III and enhances the inhibition of thrombin (factor IIa). This prevents the formation of fibrin, which is necessary for blood clotting. Heparin also inhibits the vitamin K-dependent carboxylation of glutamine residues, which is required for the activation of factors II, VII, IX, and X. Additionally, heparin binds to plasminogen, forms an active complex with it, and converts it into plasmin, which degrades fibrin and helps dissolve blood clots. Finally, heparin also stimulates the production of thrombomodulin-A2, which further inhibits thrombin formation.