Cubozoans, or box jellyfish, differ from all other cnidarians by an active fish-like behaviour and an elaborate sensory apparatus. 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. 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. 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.