We demonstrate three-dimensional spatial confinement of exciton-polaritons in a semiconductor microcavity. Polaritons are confined within a micron-sized region of slightly larger cavity thickness, called mesa, through lateral trapping of their photon component. This results in a shallow potential well that allows the simultaneous existence of extended states above the barrier. Photoluminescence spectra were measured as a function of either the emission angle or the position on the sample. Striking signatures of confined states of lower and upper polaritons, together with the corresponding extended states at higher energy, were found. In particular, the confined states appear only within the mesa region, and are characterized by a discrete energy spectrum and a broad angular pattern. A theoretical model of polariton states, based on a realistic description of the confined photon modes, supports our observations.