The invention is a cellulose derivative wherein some of the carboxyl groups of the cellulose derivative carboxymethylcellulose are replaced with -CO-NH-X-CO-Y-Z, and a hydrogel of the same. In the formula, X is a C1-10 divalent hydrocarbon group, Y is a divalent group derived from polyalkylene oxide having oxygen atoms at both ends, and Z is a C1-24 hydrocarbon group or -CO-R4, where R4 is a C1-23 hydrocarbon group.The hydrogel has excellent viscoelasticity and can be injected into prescribed sites with injecting devices such as syringes, and it can thus be utilized as a medical gel or adhesion barrier.