Electron correlation and topology are two central threads of modern condensed matter physics. Semiconductor moiré materials provide a highly tunable platform for studies of electron correlation. Correlation-driven phenomena, including the Mott insulator, generalized Wigner crystals, stripe phases and continuous Mott transition, have been demonstrated. However, nontrivial band topology has remained elusive. Here we report the observation of a quantum anomalous Hall (QAH) effect in AB-stacked MoTe2/WSe2 moiré heterobilayers. Unlike in the AA-stacked structures, an out-of-plane electric field controls not only the bandwidth but also the band topology by intertwining moiré bands centered at different high-symmetry stacking sites. At half band filling, corresponding to one particle per moiré unit cell, we observe quantized Hall resistance, h/e^2 (with h and e denoting the Planck’s constant and electron charge, respectively), and vanishing longitudinal resistance at zero magnetic field. The electric-field-induced topological phase transition from a Mott insulator to a QAH insulator precedes an insulator-to-metal transition; contrary to most known topological phase transitions, it is not accompanied by a bulk charge gap closure. Our study paves the path for discovery of a wealth of emergent phenomena arising from the combined influence of strong correlation and topology in semiconductor moiré materials.