The invention relates to a method for treating a nanofibrillar cellulose hydrogel, wherein the method comprises the steps of: providing a nanofibrillar cellulose hydrogel, wherein the nanofibrillar cellulose is oxidized nanofibrillar cellulose, wherein the oxidation has been carried out through N-oxyl mediated catalytic oxidation of cellulose-based raw material, and has at most 50 μmol of aldehyde groups per gram of dry nanofibrillar cellulose; and subjecting the nanofibrillar cellulose hydrogel to a heat treatment.