The concentration of 5-hydroxymethyl-2-furfural (HMF) is an important quality-related index in milk and milk products. Fast, cost-effective and environmentally friendly determination of HMF is of great significance in milk products control. In this study, a three-dimensional (3D) graphene-like surface (3DGrls) was successfully prepared within 5 min by an electrochemical amperometric pretreatment on a pencil graphite electrode (PGE). The fast-obtained 3D graphene-like surface increased the electrode surface area and enhanced the electron transfer capability without the addition of any harmful chemicals. The morphology and chemical composition of the obtained electrode were characterized by scanning electron microscope (SEM), X-ray photoelectron spectroscopy (XPS), Raman spectroscopy and electrochemical impedance spectroscopy (EIS). The results found that the electrochemical response to HMF at the prepared 3DGrls/PGE was 34 times higher than that at PGE. The modified electrode showed a good linear response to HMF in a concentration range of 0.35~116 μM with a low limit of detection (LOD) of 0.099 μM. The integrated electrode also exhibited excellent stability and wonderful antifouling property. Furthermore, the 3DGrls/PGE was successfully applied for the determination of HMF in three processed cheese samples with satisfactory results.