Currently, there are no clinically approved surgical glues that are nontoxic, bind strongly to tissue, and work well within wet and highly dynamic environments within the body. This is especially relevant to minimally invasive surgery that is increasingly performed to reduce postoperative complications, recovery times, and patient discomfort. We describe the engineering of a bioinspired elastic and biocompatible hydrophobic light-activated adhesive (HLAA) that achieves a strong level of adhesion to wet tissue and is not compromised by preexposure to blood. The HLAA provided an on-demand hemostatic seal, within seconds of light application, when applied to high-pressure large blood vessels and cardiac wall defects in pigs. HLAA-coated patches attached to the interventricular septum in a beating porcine heart and resisted supraphysiologic pressures by remaining attached for 24 hours, which is relevant to intracardiac interventions in humans. The HLAA could be used for many cardiovascular and surgical applications, with immediate application in repair of vascular defects and surgical hemostasis.