We introduce a hybrid qubit based on a semiconductor nanowire with an epitaxially grown superconductor layer. Josephson energy of the transmonlike device ("gatemon") is controlled by an electrostatic gate that depletes carriers in a semiconducting weak link region. Strong coupling to an on-chip microwave cavity and coherent qubit control via gate voltage pulses is demonstrated, yielding reasonably long relaxation times (~0.8 μs) and dephasing times (~1 μs), exceeding gate operation times by 2 orders of magnitude, in these first-generation devices. Because qubit control relies on voltages rather than fluxes, dissipation in resistive control lines is reduced, screening reduces cross talk, and the absence of flux control allows operation in a magnetic field, relevant for topological quantum information.