Results are discussed of an X-ray and optical observation campaign of the low-mass X-ray binary A1246-58 performed with instruments on Satellite per Astronomia X (BeppoSAX), the Rossi X-ray Timing Explorer (RXTE), the X-ray Multi-mirror Mission (XMM-Newton), the Swift mission, and the Very Large Telescope. Spectra and flux time histories are studied. The most important results are the lack of hydrogen spectral features in the optical spectrum, supporting the proposition that this is an ultracompact X-ray binary (UCXB), the determination of a 4.3 kpc distance from time-resolved spectroscopy of thermonuclear X-ray bursts, and the detection of intermediately long thermonuclear bursts as seen in a number of other UCXBs. There is evidence for a Ne/O abundance ratio in the line of sight that is higher than solar and variable. This may be due to different changes in the ionization degrees of Ne and O, which may be related to the variable irradiating flux. We discuss the spectral variability and the peculiarities of the long-term light curve.