Magnesium diboride, MgB2, has the highest transition temperature (Tc = 39 K) of the known metallic superconductors. Whether the anomalously high Tc can be described within the conventional BCS (Bardeen-Cooper-Schrieffer) framework has been debated. The key to understanding superconductivity lies with the 'superconducting energy gap' associated with the formation of the superconducting pairs. Recently, the existence of two kinds of superconducting gaps in MgB2 has been suggested by several experiments; this is in contrast to both conventional and high-Tc superconductors. A clear demonstration of two gaps has not yet been made because the previous experiments lacked the ability to resolve the momentum of the superconducting electrons. Here we report direct experimental evidence for the two-band superconductivity in MgB2, by separately observing the superconducting gaps of the σ and π bands (as well as a surface band). The gaps have distinctly different sizes, which unambiguously establishes MgB2 as a two-gap superconductor.