A β-galactosidase gene from Aspergillus oryzae was engineered utilizing codon usage optimization to be constitutively and highly expressed in the Pichia pastoris SMD1168H strain in a high-cell-density fermentation. After fermentation for 96 h in a 50-L fermentor using glucose and glycerol as combined carbon sources, the recombinant enzyme in the culture supernatant had an activity of 4,239.07 U mL(-1) with o-nitrophenyl-β-D-galactopyranoside as the substrate, and produced a total of extracellular protein content of 7.267 g L(-1) in which the target protein (6.24 g L(-1)) occupied approximately 86 %. The recombinant β-galactosidase exhibited an excellent lactose hydrolysis ability. With 1,000 U of the enzyme in 100 mL milk, 92.44 % lactose was degraded within 24 h at 60 °C, and the enzyme could also accomplish the hydrolysis at low temperatures of 37, 25, and 10 °C. Thus, this engineered strain had significantly higher fermentation level of A. oryzae lactase than that before optimization and the β-galactosidase may have a good application potential in whey and milk industries.