An electromagnetic truncated Gaussian pulse propagates through a waveguide with piecewise different dielectric constants. The waveguide contains a barrier, namely, a region of a lower dielectric constant compared to the neighboring regions. This setup yields a purely imaginary wave vector in the region of the barrier (''electromagnetic tunneling''). We calculate exactly the time-dependent Green's function for a slightly simplified dispersion relation. In order tu observe the plain tunneling effect we neglect the distortions caused by the waveguide in obtaining the transmitted pulse. The wave front of the pulse travels with the vacuum speed of light. Nevertheless, behind the burier, the maximum of the transmitted pulse turns up at an earlier time than in the case without a barrier. This effect will be explained in terms of the energy flow across the barrier, The solutions obtained reproduce the shape of the pulses measured in the tunneling experiment of Enders and Nimtz [J. Phys. (France) I2, 1693 (1992); Phys. Rev. E 48, 632 (1993); Phys. Rev. B 47, 9605 (1993); J. Phys. (France) I3, 1089 (1993); 4, 565 (1994)].