Highly thermostable β-mannanase, belonging to glycoside hydrolase family 5 subfamily 7, was purified from the culture supernatant of Talaromyces trachyspermus B168 and the cDNA of its transcript was cloned. The recombinant enzyme showed maximal activity at pH 4.5 and 85 °C. It retained more than 90 % of its activity below 60 °C. Obtaining the crystal structure of the enzyme helped us to understand the mechanism of its thermostability. An antiparallel β-sheet, salt-bridges, hydrophobic packing, proline residues in the loops, and loop shortening are considered to be related to the thermostability of the enzyme. The enzyme hydrolyzed mannans such as locust bean gum, carob galactomannan, guar gum, konjac glucomannan, and ivory nut mannan. It hydrolyzed 50.7 % of the total mannans from coffee waste, producing mannooligosaccharides. The enzyme has the highest optimum temperature among the known fungal β-mannanases and has potential for use in industrial applications.