Spintronics aims to develop electronic devices whose resistance is controlled by the spin of the charge carriers that flow through them 1-3 . This approach is illustrated by the operation of the most basic spintronic device, the spin valve 4-6 , which can be formed if two ferromagnetic electrodes are separated by a thin tunnelling barrier. In most cases, its resistance is greater when the two electrodes are magnetized in opposite directions than when they are magnetized in the same direction 7,8 . The relative difference in resistance, the so-called magnetoresistance, is then positive. However, if the transport of carriers inside the device is spin-or energy-dependent 3 , the opposite can occur and the magnetoresistance is negative 9 . The next step is to construct an analogous device to a field-effect transistor by using this effect to control spin transport and magnetoresistance with a voltage applied to a gate 10,11 . In practice though, implementing such a device has proved difficult. Here, we report on a pronounced gate-field-controlled magnetoresistance response in carbon nanotubes connected by ferromagnetic leads. Both the magnitude and the sign of the magnetoresistance in the resulting devices can be tuned in a predictable manner. This opens an important route to the realization of multifunctional spintronic devices.Early work on spin transport in multiwall carbon nanotubes (MWNTs) with Co contacts showed that spins could propagate coherently over distances as long as 250 nm (ref. 12). The tunnel magnetoresistance (TMR) = (R AP − R P )/R P , defined as the relative difference between the resistances R AP and R P in the antiparallel and parallel magnetization configuration, was found to be positive and amounted to +4% in agreement with Jullière's formula for tunnel junctions 4,13 . A negative TMR of about −30% was reported later for MWNTs contacted with similar Co contacts 14 . In these experiments, the nanotubes did not show quantum dot behaviour. It has been shown, however, that single-wall carbon nanotubes (SWNTs) and MWNTs contacted with nonferromagnetic metals could behave as quantum dots and FabryPérot resonators [15][16][17][18][19] , in which one can tune the position of discrete energy levels with a gate electrode. From this, one can expect to be able to tune the sign and the amplitude of the TMR in nanotubes, in a similar fashion as predicted originally for semiconductor heterostructures 11 .In this letter, we report on TMR measurements of MWNTs and SWNTs that are contacted with ferromagnetic electrodes and capacitively coupled to a back-gate 20 . A typical sample geometry is shown in the inset of Fig. 1. As a result of resonant tunnelling, we observe a striking oscillatory amplitude and sign modulation of the TMR as a function of the gate voltage. We have studied and observed the TMR on nine samples (seven MWNTs and two SWNTs) with various tube lengths L between the ferromagnetic electrodes (see the Methods section). We present here results for one MWNT device and one SWNT device.We first discu...