Fe/Mo/Fe and Co/Cu/Co sandwiches were grown by molecular beam epitaxy onto Mo(100) and Cu(100) single crystals, respectively, and characterized by high- and low-energy electron diffraction and in situ surface magneto-optic Kerr-effect measurements. The spacer layer in both case was fabricated to have a wedged shape in order to create a continuous change of the spacer-layer thickness. Oscillatory behavior between ferromagnetic and antiferromagnetic coupling was found; and is shown to originate at the interface between the magnetic layer and the spacer layer. For Fe/Mo/Fe, short-period oscillations are observed with a periodicity of approximately 3 ML of Mo. Hysteresis loops for antiferromagnetically coupled cases are calculated from a simple model, and the results reproduce the general characteristics observed experimentally.