The present invention relates to a method for producing a dairy product using an enzyme having lactase activity.Particular embodiments include a method for producing a fermented dairy product comprisinga) providing a milk-based substrate comprising lactose,b) treating said substrate with an enzyme having lactase activity, where the pH optimum of the lactase activity at 37°C is above pH 5, and where the lactase activity of the enzyme at pH 5 is at least 50% of its lactase activity at pH 6 when measured at 37°C, andc) fermenting said substrate with a microorganism.Also included is a method wherein the enzyme having lactase activity has an amino acid sequence which is at least 70% identical to amino acids 28-1331 of SEQ ID NO: 2.Also included is a method wherein the enzyme having lactase activity has an amino acid sequence which is at least 70% identical to amino acids 28-1931 of SEQ ID NO: 1 or a fragment thereof.Also included is a method wherein the enzyme having lactase activity is derived from a microorganism of the genus Bifidobacterium.