We present a semianalytical, seminumerical method to calculate the diffraction of elastic waves by an irregular topography of arbitrary shape. The method is a straightforward extension to three dimensions of the approach originally developed to study the diffraction of SH waves [Bouchon, 1985] and P-SV waves [Gaffet and Bouchon, 1989] by two-dimensional topographies. It relies on a boundary integral equation scheme formulated in the frequency domain where the Green functions are evaluated by the discrete wavenumber method. The principle of the method is simple. The diffracted wave field is represented as the integral over the topographic surface of an unknown source density function times the medium Green functions. The Green functions are expressed as integrals over the horizontal wavenumbers. The introduction of a spatial periodicity of the topography combined with the discretization of the surface at equal intervals results in a discretization of the wavenumber integrals and in a periodicity in the horizontal wavenumber space. As a result, the Green functions are expressed as finite sums of analytical terms. The writing of the boundary conditions of free stress at the surface yields a linear system of equations where the unknowns are the source density functions representing the diffracted wave field. Finally, this system is solved iteratively using the conjugate gradient approach. We use this method to investigate the effect of a hill on the ground motion produced during an earthquake. The hill considered is 120 m high and has an elliptical base and ratios of height-to-half-width of 0.2 and 0.4 along its major and minor axes. The results obtained show that amplification occurs at and near the top of the hill over a broad range of frequencies. For incident shear waves polarized along the short dimension of the hill the amplification at the top reaches 100% around 10 Hz and stays above 50% for frequencies between 1.5 Hz and 20 Hz. For incident shear waves polarized along the direction of elongation of the topography, the maximum amplification occurs between 2 Hz and 5 Hz with values ranging from 50% to 75%. The results also show that the geometry of the topography exerts a very strong directivity on the wave field diffracted away from the hill and that at some distance from the hill this diffracted wave field consists mostly of Rayleigh waves.