By converting energy into mechanical work, engines play a central role in most biological and technological processes. In particular, within the current trend towards the development of nanoscience and nanotechnology, microscopic engines have been attracting an ever-increasing interest. On the one hand, there has been a quest to understand how biological molecular motors work. On the other hand, several approaches have been proposed to realize artificial microscopic engines, which have been powered by the transfer of light momentum, by external magnetic fields, by in situ chemical reactions, or by the energy flow between hot and cold heat reservoirs, in scaled-down versions of macroscopic heat engines. Here, we experimentally demonstrate a microscopic engine powered by the local reversible demixing of a critical mixture. We show that, when an absorbing microsphere is optically trapped by a focused laser beam in a sub-critical mixture, it is set into rotation around the optical axis of the beam because of the emergence of diffusiophoretic propulsion; this behavior can be controlled by adjusting the optical power, the temperature, and the criticality of the mixture. Given its simplicity, this microscopic engine provides a powerful tool to power micro-and nanodevices. Furthermore, since many biological systems are tuned near criticality, this mechanism might already be at work within living organisms, for example in proteins and in cellular membranes.