The catalytic dehydration of fructose into 5-hydroxymethylfurfural is conducted in an HCl–imidazolium ionic liquid (catalyst–solvent) system, in ambient conditions. High yields and excellent recyclability make the system a promising choice for fructose dehydration. DFT calculations suggest that the solvent "switches" the dehydration from thermodynamically unfavorable into a thermodynamically favorable reaction.