Many surgeries are complicated by the need to anastomose, or reconnect, micrometre-scale vessels. Although suturing remains the gold standard for anastomosing vessels, it is difficult to place sutures correctly through collapsed lumen, making the procedure prone to failure. Here, we report a multiphase transitioning peptide hydrogel that can be injected into the lumen of vessels to facilitate suturing. The peptide, which contains a photocaged glutamic acid, forms a solid-like gel in a syringe and can be shear-thin delivered to the lumen of collapsed vessels (where it distends the vessel) and the space between two vessels (where it is used to approximate the vessel ends). Suturing is performed directly through the gel. Light is used to initiate the final gel-sol phase transition that disrupts the hydrogel network, allowing the gel to be removed and blood flow to resume. This gel adds a new tool to the armamentarium for micro- and supermicrosurgical procedures.