A novel galactosidase gene (gal3149) was identified from Bacillus velezensis SW5 and heterologously expressed in Escherichia coli BL21 (DE3). The novel galactosidase, Gal3149, encoded by gal3149 in an open reading frame of 1,299 bp, was 433 amino acids in length. Protein sequence analysis showed that Gal3149 belonged to family 4 of glycoside hydrolases (GH4). Gal3149 displayed higher enzyme activity for the substrate 2-nitrophenyl-β-d-galactopyranoside (oNPG) than for 4-nitrophenyl-α-d-galactopyranoside (pNPαG). This is the first time that an enzyme belonging to GH4 has been shown to exhibit β-galactosidase activity. Gal3149 showed optimal activity at pH 8.0 and 50°C, and exhibited excellent thermal stability, with retention of 50% relative activity after incubation at a temperature range of 0 to 50°C for 48 h. Gal3149 activity was significantly improved by K + and Na + , and was strongly or completely inhibited by Ag + , Zn 2+ , Tween-80, Cu 2+ , carboxymethyl cellulose, and oleic acid. The rate of hydrolyzed lactose in 1 mL of milk by 1 U of Gal3149 reached about 50% after incubation for 4 h. These properties lay a solid foundation for Gal3149 in application of the lactose-reduced dairy industry.