A monolithically integrated wavelength-selective photodetector, which consists of an 11.86 μm thick GaAs-based Fabry–Pérot filter and a 3.84 μm thick InP-based p-i-n absorption structure (with a 0.3 μm In0.53Ga0.47As absorption layer), was grown on a Si substrate. A crack-free and high-quality epilayer with an area of 800×700 μm2 was obtained by using midpatterned growth and thermal-cycle annealing. Long dislocations running parallel to the GaAs/Si interface were formed by thermal annealing. This kind of dislocation may effectively alleviate the thermal stress across a large patterned area and be responsible for the crack-free epilayer. A photodetector with a spectral linewidth of 1.1 nm (full width at half maximum) and a quantum efficiency of 9.0% was demonstrated.