  Context. The origin of giant planets at moderate separations
$\simeq$$1$$-$$10$ au is still not fully understood because numerical studies
of Type II migration in protoplanetary disks often predict a decay of the
semi-major axis that is too fast. According to recent 2D simulations, inward
migration of a gap-opening planet can be slowed down or even reversed if the
outer gap edge becomes heated by irradiation from the central star, and puffed
up.
  Aims. Here we study how stellar irradiation reduces the disk-driven torque
and affects migration in more realistic 3D disks.
  Methods. Using 3D hydrodynamic simulations with radiation transfer, we
investigated the static torque acting on a single gap-opening planet embedded
in a passively heated accretion disk.
  Results. Our simulations confirm that a temperature inversion is established
at the irradiated outer gap edge and the local increase of the scale height
reduces the magnitude of the negative outer Lindblad torque. However, the
temperature excess is smaller than assumed in 2D simulations and the torque
reduction only becomes prominent for specific parameters. For the viscosity
$\alpha=10^{-3}$, the total torque is reduced for planetary masses ranging from
$0.1$ to $0.7$ Jupiter mass, with the strongest reduction being by a factor of
$-0.17$ (implying outward migration) for a Saturn-mass planet. For a
Jupiter-mass planet, the torque reduction becomes stronger with increasing
$\alpha$ (the torque is halved when $\alpha=5\times10^{-3}$).
  Conclusions. We conclude that planets that open moderately wide and deep gaps
are subject to the largest torque modifications and their Type II migration can
be stalled due to gap edge illumination. We then argue that the torque
reduction can help to stabilize the orbits of giant planets forming at
$\gtrsim$$1$ au.
