An alpha-galactosidase gene from the thermophilic bacterium Bacillus stearothermophilus NUB3621 was cloned, sequenced, expressed in Escherichia coli and the recombinant protein was purified. The Bacillus enzyme, designated AgaN, is similar to alpha-galactosidases of family 36 in the classification of glycosyl hydrolases. The enzyme was estimated to be a tetramer with a molecular mass of subunits 80.3 kDa. The purified AgaN is thermostable and has a temperature optimum of activity at 75 degrees C and a half-life of inactivation of 19 h at 70 degrees C. AgaN displays high affinity for oligomeric substrates such as melibiose and raffinose and is able to hydrolyze raffinose in the presence of 60% sucrose with high efficiency.