The avalanche photodiode (APD) is a high-performance and compact light sensor recently applied in various fields of experimental physics. Among several types of APDs, the reach-through APD offers an advantage in direct X-ray detection, thanks to its thick depletion layer (⩾100μm) in front of the amplification region. This type of APD is also sensitive to weak scintillation light from gamma-ray scintillators with a high quantum efficiency of ˜80% (at λ≃500nm). In this paper, we propose a novel design of a compact X-ray-to-gamma-ray detector widely applicable between 1 keV and several hundreds of keV. The prototype consists of a reach-through APD (transmission type) optically coupled with a cubic CsI(Tl) crystal 4×4×4mm in size. By applying the pulse shape discrimination technique to the APD output, we successfully discriminated the X-ray signals directly detected within the APD (1 40 keV), and gamma-ray signals absorbed in a CsI(Tl) scintillator (10 800 keV) located immediately behind the APD. Optimum FWHM energy resolutions of 15.1±0.2%, 6.6±0.4%, and 7.6±0.1% were obtained for 5.9 keV X-rays, 32 keV X-rays, and 662 keV gamma rays, respectively, measured at +20C. This stacked configuration is viable for various future applications in space science and nuclear medicine.