Post-operative adhesions form as a result of normal wound healing processes following any type of surgery. In cardiac surgery, pericardial adhesions are particularly problematic during reoperations, as surgeons must release the adhesions from the surface of the heart before the intended procedure can begin, thereby substantially lengthening operation times and introducing risks of haemorrhage and injury to the heart and lungs during sternal re-entry and cardiac dissection. Here we show that a dynamically crosslinked supramolecular polymer-nanoparticle hydrogel, with viscoelastic and flow properties that enable spraying onto tissue as well as robust tissue adherence and local retention in vivo for two weeks, reduces the formation of pericardial adhesions. In a rat model of severe pericardial adhesions, the hydrogel markedly reduced the severity of the adhesions, whereas commercial adhesion barriers (including Seprafilm and Interceed) did not. The hydrogels also reduced the severity of cardiac adhesions (relative to untreated animals) in a clinically relevant cardiopulmonary-bypass model in sheep. This viscoelastic supramolecular polymeric hydrogel represents a promising clinical solution for the prevention of post-operative pericardial adhesions.