Fast radio bursts (FRBs) are short pulses observed in radio band from cosmological distances. One class of models invoke soft gamma-ray repeaters (SGRs), or magnetars, as the sources of FRBs. Some radio pulses have been observed from some magnetars, however, no FRB-like events had been detected in association any magnetar burst, including one giant flare. Recently, a pair of FRB-like bursts (FRB 200428 hereafter) separated by milliseconds (ms) were detected from the general direction of the Galactic magnetar SGR J1935+2154. Here we report the detection of a non-thermal X-ray burst in the 1-250 keV energy band with the Insight-HXMT satellite, which we identify as emitted from SGR J1935+2154. The burst showed two hard peaks with a separation of 34 ms, broadly consistent with that of the two bursts in FRB 200428. The delay time between the double radio and X-ray peaks is about 8.57 s, fully consistent with the dispersion delay of FRB 200428. We thus identify the non-thermal X-ray burst is associated with FRB 200428 whose high energy counterpart is the two hard peaks in X-ray. Our results suggest that the non-thermal X-ray burst and FRB 200428 share the same physical origin in an explosive event from SGR J1935+2154.