Controlling a quantum system by using observations of its dynamics is complicated by the backaction of the measurement process-that is, the unavoidable quantum disturbance caused by coupling the system to a measurementapparatus. An efficient measurement is one that maximizes the amount of information gained per disturbance incurred. Real-time feedback canthen be used to cancel the backaction of the measurement and to control the evolution of the quantum state. Such measurement-based quantum control has been demonstrated in the clean settings of cavity and circuit quantum electrodynamics, but its application to motional degrees of freedomhas remained elusive. Here we demonstrate measurement-based quantum control of the motion of a millimetre-sized membrane resonator. An optomechanical transducer resolves the zero-point motion of the resonator in a fraction of its millisecond-scale coherence time, with an overall measurement efficiency close to unity. An electronic feedback loop converts this position record to a force that cools the resonator mode to its quantum ground state (residual thermal occupation of about 0.29). This occupation is nine decibels below the quantum-backaction limit of sideband cooling and six orders of magnitude below the equilibrium occupation of the thermal environment. We thus realize a long-standing goal in the field, adding position and momentum to the degrees of freedom that are amenable to measurement-based quantum control, with potential applications in quantum information processing and gravitational-wave detectors.