A fast radio burst (FRB) was recently detected to be associated with a hard X-ray burst from the Galactic magnetar SGR 1935+2154. Scenarios involving magnetars for FRBs are hence highly favored. In this work, we suggest that the impact between an asteroid and a magnetar could explain such a detection. According to our calculations, an asteroid of mass $10^{20}$ g will be disrupted at a distance of $7 times 10^9$ cm when approaching the magnetar. The accreted material will flow along the magnetic field lines from the Alfven radius $sim 10^7$ cm. After falling onto the magnetars surface, an instant accretion column will be formed, producing a Comptonized X-ray burst and an FRB in the magnetosphere. We show that all the observational features of FRB 200428 could be interpreted self-consistently in this scenario. We predict quasi-periodic oscillations in this specific X-ray burst, which can serve as an independent observational test.