We describe MANTIS (Monte carlo x-rAy electroN opTical Imaging Simulation), a tool for simulating imaging systems that tracks x-rays, electrons and optical photons in arbitrary materials and complex geometries. The x-ray and electron transport and involved physics models are from the PENELOPE package, and the optical transport and corresponding physics models are from DETECT-II and include Fresnel refraction and reflection at material boundaries, bulk absorption and scattering. Complex geometries can be handled with the aid of the geometry routines included in PENELOPE. When x-rays or electrons interact and deposit energy in the scintillator, the code generates a number of optical quanta according to a user-selected model for the conversion process. The optical photons are then tracked until they reach an absorption event, which in some cases contributes to the output signal, or escape from the geometry. We demonstrate the capabilities of this new tool with respect to the statistics of the optical signal detected and to the three-dimensional point-response functions corresponding to columnar phosphor screens.