Chromophores absorb light in photosensitive proteins and thereby initiate fundamental biological processes such as photosynthesis, vision and biofluorescence. An important goal in their understanding is the provision of detailed structural descriptions of the ultrafast photochemical events that they undergo, in particular of the excited states that connect chemistry to biological function. Here we report on the structures of two excited states in the reversibly photoswitchable fluorescent protein rsEGFP2. We populated the states through femtosecond illumination of rsEGFP2 in its non-fluorescent off state and observed their build-up (within less than one picosecond) and decay (on the several picosecond timescale). Using an X-ray free-electron laser, we performed picosecond time-resolved crystallography and show that the hydroxybenzylidene imidazolinone chromophore in one of the excited states assumes a near-canonical twisted configuration halfway between the trans and cis isomers. This is in line with excited-state quantum mechanics/molecular mechanics and classical molecular dynamics simulations. Our new understanding of the structure around the twisted chromophore enabled the design of a mutant that displays a twofold increase in its off-to-on photoswitching quantum yield.