Pills are the cornerstone of medicine, but they are difficult to swallow. Although liquid formulations are easier to ingest, they lack the ability to target therapy with excipients and cannot be used as controlled release devices. Here, we describe a drug preparation based on liquid in-situ forming tough (LIFT) hydrogel, which combines the advantages of solid and liquid formulations. The LIFT hydrogel is directly formed in the stomach by taking in the cross-linking agent solution of calcium and mercaptan cross-linking agent in turn, and then taking in the alginate containing medicine and four arm polyethylene glycol maleimide polymer solution. We show that LIFT hydrogel is stably formed in the stomach of rats and pigs in vivo, and has mechanical toughness, biocompatibility and safe clearance after 24 hours. The LIFT hydrogel delivers the total drug dose equivalent to the unpacked drug in a controlled manner, and protects the encapsulated therapeutic enzymes and bacteria from gastric acid mediated inactivation. In general, LIFT hydrogel can expand the opportunity for patients with dysphagia to obtain advanced treatment.