The control of charge transport in an active electronic device depends intimately on the modulation of the internal charge density by an external node. For example, a field-effect transistor relies on the gated electrostatic modulation of the channel charge produced by changing the relative position of the conduction and valence bands with respect to the electrodes. In molecular-scale devices, a longstanding challenge has been to create a true three-terminal device that operates in this manner (that is, by modifying orbital energy). Here we report the observation of such a solid-state molecular device, in which transport current is directly modulated by an external gate voltage. Resonance-enhanced coupling to the nearest molecular orbital is revealed by electron tunnelling spectroscopy, demonstrating direct molecular orbital gating in an electronic device. Our findings demonstrate that true molecular transistors can be created, and so enhance the prospects for molecularly engineered electronic devices.