Solid-state superconducting circuits are versatile systems in which quantum states can be engineered and controlled. Recent progress in this area has opened up exciting possibilities for exploring fundamental physics as well as applications in quantum information technology; in a series of experiments it was shown that such circuits can be exploited to generate quantum optical phenomena, by designing superconducting elements as artificial atoms that are coupled coherently to the photon field of a resonator. Here we demonstrate a lasing effect with a single artificial atom - a Josephson-junction charge qubit - embedded in a superconducting resonator. We make use of one of the properties of solid-state artificial atoms, namely that they are strongly and controllably coupled to the resonator modes. The device is essentially different from existing lasers and masers; one and the same artificial atom excited by current injection produces many photons.