Directly detecting thermal emission from young extrasolar planets allows measurement of their atmospheric compositions and luminosities, which are influenced by their formation mechanisms. Using the Gemini Planet Imager, we discovered a planet orbiting the ~20-million-year-old star 51 Eridani at a projected separation of 13 astronomical units. Near-infrared observations show a spectrum with strong methane and water-vapor absorption. Modeling of the spectra and photometry yields a luminosity (normalized by the luminosity of the Sun) of 1.6 to 4.0 × 10(-6) and an effective temperature of 600 to 750 kelvin. For this age and luminosity, "hot-start" formation models indicate a mass twice that of Jupiter. This planet also has a sufficiently low luminosity to be consistent with the "cold-start" core-accretion process that may have formed Jupiter