A young and energetic pulsar powers the well-known Crab Nebula. Here, we describe two separate gamma-ray (photon energy greater than 100 mega-electron volts) flares from this source detected by the Large Area Telescope on board the Fermi Gamma-ray Space Telescope. The first flare occurred in February 2009 and lasted approximately 16 days. The second flare was detected in September 2010 and lasted approximately 4 days. During these outbursts, the gamma-ray flux from the nebula increased by factors of four and six, respectively. The brevity of the flares implies that the gamma rays were emitted via synchrotron radiation from peta-electron-volt (10(15) electron volts) electrons in a region smaller than 1.4 × 10(-2) parsecs. These are the highest-energy particles that can be associated with a discrete astronomical source, and they pose challenges to particle acceleration theory.