Significance: How to achieve effective treatment of diabetic ulcer (DU) is still a major challenge in the clinic. Herein, we propose an effective strategy to perfectly address all the problems faced in the treatment of DU. A near-infrared–responsive black phosphorus-based sprayed fibrin gel capable of alleviating pain, eliminating bacteria, reducing inflammation, and promoting angiogenesis is developed. The promoting wound healing and pain relief effects in the diabetic mouse ulcer model indicate this gel is a valuable wound dressing for effective treatment of DU and other advanced wounds. We anticipate that this therapeutic strategy may be generalized for treating other disorders such as chronic inflammation and infections.