Theories of the formation and early evolution of planetary systems postulate that planets are born in circumstellar disks, and undergo radial migration during and after dissipation of the dust and gas disk from which they formed. The precise ages of meteorites indicate that planetesimals—the building blocks of planets—are produced within the first million years of a star’s life. Fully formed planets are frequently detected on short orbital periods around mature stars. Some theories suggest that the in situ formation of planets close to their host stars is unlikely and that the existence of such planets is therefore evidence of large-scale migration. Other theories posit that planet assembly at small orbital separations may be common. Here we report a newly born, transiting planet orbiting its star with a period of 5.4 days. The planet is 50 per cent larger than Neptune, and its mass is less than 3.6 times that of Jupiter (at 99.7 per cent confidence), with a true mass likely to be similar to that of Neptune. The star is 5-10 million years old and has a tenuous dust disk extending outward from about twice the Earth-Sun separation, in addition to the fully formed planet located at less than one-twentieth of the Earth-Sun separation.