Stars form by accreting material from their surrounding disks. There is a consensus that matter flowing through the disk is channelled onto the stellar surface by the stellar magnetic field. This is thought to be strong enough to truncate the disk close to the corotation radius, at which the disk rotates at the same rate as the star. Spectro-interferometric studies in young stellar objects show that hydrogen emission (a well known tracer of accretion activity) mostly comes from a region a few milliarcseconds across, usually located within the dust sublimation radius1-3. The origin of the hydrogen emission could be the stellar magnetosphere, a rotating wind or a disk. In the case of intermediate-mass Herbig AeBe stars, the fact that Brackett γ (Brγ) emission is spatially resolved rules out the possibility that most of the emission comes from the magnetosphere4-6 because the weak magnetic fields (some tenths of a gauss) detected in these sources7,8 result in very compact magnetospheres. In the case of T Tauri sources, their larger magnetospheres should make them easier to resolve. The small angular size of the magnetosphere (a few tenths of a milliarcsecond), however, along with the presence of winds9,10 make the interpretation of the observations challenging. Here we report optical long-baseline interferometric observations that spatially resolve the inner disk of the T Tauri star TW Hydrae. We find that the near-infrared hydrogen emission comes from a region approximately 3.5 stellar radii across. This region is within the continuum dusty disk emitting region (7 stellar radii across) and also within the corotation radius, which is twice as big. This indicates that the hydrogen emission originates in the accretion columns (funnel flows of matter accreting onto the star), as expected in magnetospheric accretion models, rather than in a wind emitted at much larger distance (more than one astronomical unit).