Massive planets have now been found orbiting about 80 stars. A long outstanding question critical to theories of planet formation has been the timescale on which gas-giant planets form; in particular, stars more massive than the Sun may blow away the surrounding gas associated with their formation more quickly than it can be accumulated by the protoplanetary cores. Evidence for a protoplanet around a Herbig AeBe star (such stars are 2 3 times more massive than the Sun) would constrain the timescale of planet formation. Here we report the detection of CO and H(3)(+) emission from the 5-10-million-year-old Herbig AeBe star HD141569. We interpret the CO data as indicating that the inner disk surrounding the star is past the early phase of accretion and planetesimal formation, and that most of the gas has been cleared out to a distance of more than 17 astronomical units. CO effectively destroys H(3)(+) (ref. 2), so their presence in the same source is surprising. Moreover, H(3)(+) line emission has previously been detected only from the atmospheres of the giant planets in the Solar System. The H(3)(+) and CO may therefore be distributed in the disk at different circumstellar distances, or, alternatively, H(3)(+) may be located in the extended envelope of a protoplanet.