The conversion of energy into mechanical work is essential for almost any industrial process. The original description of classical heat engines by Sadi Carnot in 1824 has largely shaped our understanding of work and heat exchange during macroscopic thermodynamic processes. Equipped with our present-day ability to design and control mechanical devices at micro- and nanometre length scales, we are now in a position to explore the limitations of classical thermodynamics, arising on scales for which thermal fluctuations are important. Here we demonstrate the experimental realization of a microscopic heat engine, comprising a single colloidal particle subject to a time-dependent optical laser trap. The work associated with the system is a fluctuating quantity, and depends strongly on the cycle duration time, tau, which in turn determines the efficiency of our heat engine. Our experiments offer a rare insight into the conversion of thermal to mechanical energy on a microscopic level, and pave the way for the design of future micromechanical machines.