Context.A new generation of powerful and efficient spectropolarimeters has recently been used to provide the first sample of magnetic Ap stars of accurately known ages. Modelling of these data offer the possibility of significant new insights into the physics and main sequence evolution of these remarkable stars. Aims. New spectra have been obtained with the ESPaDOnS spectropolarimeter, and are supplemented with unpolarised spectra from the ESO UVES, UVES-FLAMES, and HARPS spectrographs, of the very peculiar large-field magnetic Ap star HD 318107, a member of the open cluster NGC 6405 and thus a star with a well-determined age. The available data provide sufficient material with which to re-analyse the first-order model of the magnetic field geometry and to derive chemical abundances of Si, Ti, Fe, Nd, Pr, Mg, Cr, Mn, O, and Ca. Methods. The models were obtained using ZEEMAN, a program which synthesises spectral line profiles for stars that have magnetic fields. The magnetic field structure was modelled with a low-order colinear multipole expansion, using coefficients derived from the observed variations of the field strength with rotation phase. The abundances of several elements were determined using spectral synthesis. After experiments with a very simple model of uniform abundance on each of three rings of equal width in co-latitude and symmetric about the assumed magnetic axis, we decided to model the spectra assuming uniform abundances of each element over the stellar surface. Results. The new magnetic field measurements allow us to refine the rotation period of HD 318107 to P = 9.7088 ± 0.0007 days. Appropriate magnetic field model parameters were found that very coarsely describe the (apparently rather complex) field moment variations. Spectrum synthesis leads to the derivation of mean abundances for the elements Mg, Si, Ca, Ti, Cr, Fe, Nd, and Pr. All of these elements except for Mg and Ca are strongly overabundant compared to the solar abundance ratios. There is considerable evidence of non-uniformity, for example in the different values of B z found using lines of different elements. Conclusions. The present data set, while limited, is nevertheless sufficient to provide a useful first-order assessment of both the magnetic and surface abundance properties of HD 318107, making it one of the very few magnetic Ap stars of well-known age for which both of these properties have been studied.