Cubozoans, or box jellyfish, differ from all other cnidarians by an active fish-like behaviour and an elaborate sensory apparatus(1,2). Each of the four sides of the animal carries a conspicuous sensory club ( the rhopalium), which has evolved into a bizarre cluster of different eyes(3). Two of the eyes on each rhopalium have long been known to resemble eyes of higher animals, but the function and performance of these eyes have remained unknown(4). Here we show that box-jellyfish lenses contain a finely tuned refractive index gradient producing nearly aberration-free imaging. This demonstrates that even simple animals have been able to evolve the sophisticated visual optics previously known only from a few advanced bilaterian phyla. However, the position of the retina does not coincide with the sharp image, leading to very wide and complex receptive fields in individual photoreceptors. We argue that this may be useful in eyes serving a single visual task. The findings indicate that tailoring of complex receptive fields might have been one of the original driving forces in the evolution of animal lenses.