A novel core-shell heterostructure of CuxO nanoparticles@zeolitic imidazolate framework (CuxO NPs@ZIF-8) was successfully prepared through facile pyrolysis of a nanocrystalline copper-based metal-organic framework [nHKUST-1, i.e., Cu3(BTC)2 (BTC = 1,3,5-benzene-tricarboxylate)]@ZIF-8, based on the different thermal stability of the two metal-organic frameworks (MOFs). The small CuxO NPs derived from nHKUST-1 were uniformly dispersed inside the host material and provided active sites, while ZIF-8 kept the original structure as the molecular sieving shell. Owing to the proper pore shape and pore size of ZIF-8, H2O2 could diffuse through the shell, but bigger molecules could not pass. Thus, the composite material exhibited high selectivity when it was used to construct a H2O2 sensor. In addition, the sensor showed an extended linear detection range (from 1.5 to 21442 μM), low detection limit (0.15 μM), and high sensitivity, due to the good electrocatalysis of CuxO NPs and the synergistic effect of the core-shell structure.